mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
Enable werror for javadoc and fix javadoc issues
This commit is contained in:
parent
4249c1a845
commit
1a3067c89b
323 changed files with 2929 additions and 2704 deletions
|
@ -37,15 +37,15 @@ import org.jxmpp.jid.BareJid;
|
|||
*
|
||||
* Alternatively this implementation can be used as an ephemeral keystore without a persisting backend.
|
||||
*
|
||||
* @param <T_IdKeyPair>
|
||||
* @param <T_IdKey>
|
||||
* @param <T_PreKey>
|
||||
* @param <T_SigPreKey>
|
||||
* @param <T_Sess>
|
||||
* @param <T_Addr>
|
||||
* @param <T_ECPub>
|
||||
* @param <T_Bundle>
|
||||
* @param <T_Ciph>
|
||||
* @param <T_IdKeyPair> the type of the id key pair.
|
||||
* @param <T_IdKey> the type of the id key.
|
||||
* @param <T_PreKey> the prekey type
|
||||
* @param <T_SigPreKey> the signed prekey type.
|
||||
* @param <T_Sess> the session type.
|
||||
* @param <T_Addr> the address type.
|
||||
* @param <T_ECPub> the EC pub type.
|
||||
* @param <T_Bundle> the bundle type.
|
||||
* @param <T_Ciph> the cipher type.
|
||||
*/
|
||||
public class CachingOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph>
|
||||
extends OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> {
|
||||
|
@ -437,7 +437,7 @@ public class CachingOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Se
|
|||
|
||||
/**
|
||||
* Return the {@link KeyCache} object of an {@link OmemoManager}.
|
||||
* @param device
|
||||
* @param device TODO javadoc me please
|
||||
* @return
|
||||
*/
|
||||
private KeyCache<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess> getCache(OmemoDevice device) {
|
||||
|
|
|
@ -514,7 +514,7 @@ public abstract class FileBasedOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigP
|
|||
|
||||
/**
|
||||
* Delete a directory with all subdirectories.
|
||||
* @param root
|
||||
* @param root TODO javadoc me please
|
||||
*/
|
||||
public static void deleteDirectory(File root) {
|
||||
File[] currList;
|
||||
|
|
|
@ -150,7 +150,7 @@ public final class OmemoManager extends Manager {
|
|||
* @param connection XmppConnection.
|
||||
* @param deviceId MUST NOT be null and MUST be greater than 0.
|
||||
*
|
||||
* @return manager
|
||||
* @return manager TODO javadoc me please
|
||||
*/
|
||||
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection, Integer deviceId) {
|
||||
if (deviceId == null || deviceId < 1) {
|
||||
|
@ -181,7 +181,7 @@ public final class OmemoManager extends Manager {
|
|||
*
|
||||
* @param connection XmppConnection.
|
||||
*
|
||||
* @return manager
|
||||
* @return manager TODO javadoc me please
|
||||
*/
|
||||
public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) {
|
||||
TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection);
|
||||
|
@ -227,14 +227,14 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Initializes the OmemoManager. This method must be called before the manager can be used.
|
||||
*
|
||||
* @throws CorruptedOmemoKeyException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws IOException
|
||||
* @throws CorruptedOmemoKeyException if the OMEMO key is corrupted.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized void initialize()
|
||||
throws SmackException.NotLoggedInException, CorruptedOmemoKeyException, InterruptedException,
|
||||
|
@ -278,7 +278,7 @@ public final class OmemoManager extends Manager {
|
|||
* @see #requestDeviceListUpdateFor(BareJid)
|
||||
* @param contact contact we want to get a set of device of.
|
||||
* @return set of known devices of that contact.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public Set<OmemoDevice> getDevicesOf(BareJid contact) throws IOException {
|
||||
OmemoCachedDeviceList list = getOmemoService().getOmemoStoreBackend().loadCachedDeviceList(getOwnDevice(), contact);
|
||||
|
@ -300,11 +300,11 @@ public final class OmemoManager extends Manager {
|
|||
* @return encrypted message
|
||||
* @throws CryptoFailedException when something crypto related fails
|
||||
* @throws UndecidedOmemoIdentityException When there are undecided devices
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public OmemoMessage.Sent encrypt(BareJid recipient, String message)
|
||||
throws CryptoFailedException, UndecidedOmemoIdentityException,
|
||||
|
@ -323,11 +323,11 @@ public final class OmemoManager extends Manager {
|
|||
* @return encrypted message.
|
||||
* @throws CryptoFailedException When something crypto related fails
|
||||
* @throws UndecidedOmemoIdentityException When there are undecided devices.
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized OmemoMessage.Sent encrypt(Set<BareJid> recipients, String message)
|
||||
throws CryptoFailedException, UndecidedOmemoIdentityException,
|
||||
|
@ -348,14 +348,14 @@ public final class OmemoManager extends Manager {
|
|||
* @param message message to send
|
||||
* @return encrypted message
|
||||
* @throws UndecidedOmemoIdentityException when there are undecided devices.
|
||||
* @throws CryptoFailedException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws CryptoFailedException if the OMEMO cryptography failed.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws NoOmemoSupportException When the muc doesn't support OMEMO.
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized OmemoMessage.Sent encrypt(MultiUserChat muc, String message)
|
||||
throws UndecidedOmemoIdentityException, CryptoFailedException,
|
||||
|
@ -387,7 +387,7 @@ public final class OmemoManager extends Manager {
|
|||
* @throws CorruptedOmemoKeyException if our or their key is corrupted
|
||||
* @throws NoRawSessionException if the message was not a preKeyMessage, but we had no session with the contact
|
||||
* @throws CryptoFailedException if decryption fails
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public OmemoMessage.Received decrypt(BareJid sender, OmemoElement omemoElement)
|
||||
throws SmackException.NotLoggedInException, CorruptedOmemoKeyException, NoRawSessionException,
|
||||
|
@ -402,7 +402,7 @@ public final class OmemoManager extends Manager {
|
|||
* @param mamQuery The MAM query
|
||||
* @return list of decrypted OmemoMessages
|
||||
* @throws SmackException.NotLoggedInException if the Manager is not authenticated.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public List<MessageOrOmemoMessage> decryptMamQueryResult(MamManager.MamQuery mamQuery)
|
||||
throws SmackException.NotLoggedInException, IOException {
|
||||
|
@ -446,7 +446,7 @@ public final class OmemoManager extends Manager {
|
|||
* be of length 64.
|
||||
* @param device device
|
||||
* @param fingerprint fingerprint
|
||||
* @return
|
||||
* @return <code>true</code> if this is a trusted OMEMO identity.
|
||||
*/
|
||||
public boolean isTrustedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
|
||||
if (trustCallback == null) {
|
||||
|
@ -462,7 +462,7 @@ public final class OmemoManager extends Manager {
|
|||
* be of length 64.
|
||||
* @param device device
|
||||
* @param fingerprint fingerprint
|
||||
* @return
|
||||
* @return <code>true</code> if the trust is decided for the identity.
|
||||
*/
|
||||
public boolean isDecidedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
|
||||
if (trustCallback == null) {
|
||||
|
@ -480,12 +480,12 @@ public final class OmemoManager extends Manager {
|
|||
* @throws CorruptedOmemoKeyException When the used identityKeys are corrupted
|
||||
* @throws CryptoFailedException When something fails with the crypto
|
||||
* @throws CannotEstablishOmemoSessionException When we can't establish a session with the recipient
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws NoSuchAlgorithmException if no such algorithm is available.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized void sendRatchetUpdateMessage(OmemoDevice recipient)
|
||||
throws SmackException.NotLoggedInException, CorruptedOmemoKeyException, InterruptedException,
|
||||
|
@ -508,12 +508,12 @@ public final class OmemoManager extends Manager {
|
|||
*
|
||||
* @param contact contact
|
||||
* @return true if contact has at least one OMEMO capable device.
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized boolean contactSupportsOmemo(BareJid contact)
|
||||
throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
|
||||
|
@ -547,10 +547,10 @@ public final class OmemoManager extends Manager {
|
|||
* @param connection XMPPConnection
|
||||
* @param server domainBareJid of the server to test
|
||||
* @return true if server supports pep
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
*/
|
||||
public static boolean serverSupportsOmemo(XMPPConnection connection, DomainBareJid server)
|
||||
throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException,
|
||||
|
@ -562,10 +562,10 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Return the fingerprint of our identity key.
|
||||
*
|
||||
* @return fingerprint
|
||||
* @return fingerprint TODO javadoc me please
|
||||
* @throws SmackException.NotLoggedInException if we don't know our bareJid yet.
|
||||
* @throws CorruptedOmemoKeyException if our identityKey is corrupted.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized OmemoFingerprint getOwnFingerprint()
|
||||
throws SmackException.NotLoggedInException, CorruptedOmemoKeyException, IOException {
|
||||
|
@ -579,14 +579,14 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Get the fingerprint of a contacts device.
|
||||
* @param device contacts OmemoDevice
|
||||
* @return fingerprint
|
||||
* @return fingerprint TODO javadoc me please
|
||||
* @throws CannotEstablishOmemoSessionException if we have no session yet, and are unable to create one.
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws CorruptedOmemoKeyException if the copy of the fingerprint we have is corrupted.
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized OmemoFingerprint getFingerprint(OmemoDevice device)
|
||||
throws CannotEstablishOmemoSessionException, SmackException.NotLoggedInException,
|
||||
|
@ -610,13 +610,13 @@ public final class OmemoManager extends Manager {
|
|||
* @param contact contact
|
||||
* @return Map of all active devices of the contact and their fingerprints.
|
||||
*
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws CorruptedOmemoKeyException
|
||||
* @throws CannotEstablishOmemoSessionException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws CorruptedOmemoKeyException if the OMEMO key is corrupted.
|
||||
* @throws CannotEstablishOmemoSessionException if no OMEMO session could be established.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized HashMap<OmemoDevice, OmemoFingerprint> getActiveFingerprints(BareJid contact)
|
||||
throws SmackException.NotLoggedInException, CorruptedOmemoKeyException,
|
||||
|
@ -681,12 +681,12 @@ public final class OmemoManager extends Manager {
|
|||
* Request a deviceList update from contact contact.
|
||||
*
|
||||
* @param contact contact we want to obtain the deviceList from.
|
||||
* @throws InterruptedException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public synchronized void requestDeviceListUpdateFor(BareJid contact)
|
||||
throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
|
||||
|
@ -697,13 +697,13 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Publish a new device list with just our own deviceId in it.
|
||||
*
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
*/
|
||||
public void purgeDeviceList()
|
||||
throws SmackException.NotLoggedInException, InterruptedException, XMPPException.XMPPErrorException,
|
||||
|
@ -721,9 +721,9 @@ public final class OmemoManager extends Manager {
|
|||
* @throws XMPPException.XMPPErrorException XMPP error
|
||||
* @throws SmackException.NotConnectedException XMPP error
|
||||
* @throws SmackException.NoResponseException XMPP error
|
||||
* @throws SmackException.NotLoggedInException
|
||||
* @throws IOException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws SmackException.NotLoggedInException if the XMPP connection is not authenticated.
|
||||
* @throws IOException if an I/O error occured.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
*/
|
||||
public synchronized void rotateSignedPreKey()
|
||||
throws CorruptedOmemoKeyException, SmackException.NotLoggedInException, XMPPException.XMPPErrorException,
|
||||
|
@ -761,7 +761,7 @@ public final class OmemoManager extends Manager {
|
|||
|
||||
/**
|
||||
* Returns a pseudo random number from the interval [1, Integer.MAX_VALUE].
|
||||
* @return deviceId
|
||||
* @return deviceId TODO javadoc me please
|
||||
*/
|
||||
public static int randomDeviceId() {
|
||||
return new Random().nextInt(Integer.MAX_VALUE - 1) + 1;
|
||||
|
@ -770,7 +770,7 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Return the BareJid of the user.
|
||||
*
|
||||
* @return bareJid
|
||||
* @return bareJid TODO javadoc me please
|
||||
*/
|
||||
public BareJid getOwnJid() {
|
||||
if (ownJid == null && connection().isAuthenticated()) {
|
||||
|
@ -783,7 +783,7 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Return the deviceId of this OmemoManager.
|
||||
*
|
||||
* @return deviceId
|
||||
* @return deviceId TODO javadoc me please
|
||||
*/
|
||||
public synchronized Integer getDeviceId() {
|
||||
return deviceId;
|
||||
|
@ -792,7 +792,7 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Return the OmemoDevice of the user.
|
||||
*
|
||||
* @return omemoDevice
|
||||
* @return omemoDevice TODO javadoc me please
|
||||
*/
|
||||
public synchronized OmemoDevice getOwnDevice() {
|
||||
BareJid jid = getOwnJid();
|
||||
|
@ -895,10 +895,10 @@ public final class OmemoManager extends Manager {
|
|||
*
|
||||
* @param contactsDevice OmemoDevice of a contact.
|
||||
*
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws CorruptedOmemoKeyException if our or their identityKey is corrupted.
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws CannotEstablishOmemoSessionException if no new session can be established.
|
||||
* @throws SmackException.NotLoggedInException if the connection is not authenticated.
|
||||
*/
|
||||
|
@ -924,7 +924,7 @@ public final class OmemoManager extends Manager {
|
|||
/**
|
||||
* Return the OMEMO service object.
|
||||
*
|
||||
* @return omemoService
|
||||
* @return omemoService TODO javadoc me please
|
||||
*/
|
||||
OmemoService<?, ?, ?, ?, ?, ?, ?, ?, ?> getOmemoService() {
|
||||
throwIfNoServiceSet();
|
||||
|
|
|
@ -48,7 +48,7 @@ public class OmemoMessage {
|
|||
/**
|
||||
* Return the original OmemoElement (<encrypted/>).
|
||||
*
|
||||
* @return omemoElement
|
||||
* @return omemoElement TODO javadoc me please
|
||||
*/
|
||||
public OmemoElement getElement() {
|
||||
return element;
|
||||
|
@ -57,7 +57,7 @@ public class OmemoMessage {
|
|||
/**
|
||||
* Return the messageKey (or transported key in case of a KeyTransportMessage).
|
||||
*
|
||||
* @return key
|
||||
* @return key TODO javadoc me please
|
||||
*/
|
||||
public byte[] getKey() {
|
||||
return messageKey.clone();
|
||||
|
@ -124,7 +124,7 @@ public class OmemoMessage {
|
|||
* and an EME hint about OMEMO encryption.
|
||||
*
|
||||
* @param recipient recipient for the to-field of the message.
|
||||
* @return Message
|
||||
* @return Message TODO javadoc me please
|
||||
*/
|
||||
public Message asMessage(Jid recipient) {
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class OmemoMessage {
|
|||
|
||||
/**
|
||||
* Return the OmemoDevice which sent the message.
|
||||
* @return senderDevice
|
||||
* @return senderDevice TODO javadoc me please
|
||||
*/
|
||||
public OmemoDevice getSenderDevice() {
|
||||
return senderDevice;
|
||||
|
|
|
@ -62,11 +62,11 @@ public abstract class OmemoRatchet<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param encryptedKey key encrypted with the ratchet of the sender.
|
||||
* @return decrypted message key.
|
||||
*
|
||||
* @throws CorruptedOmemoKeyException
|
||||
* @throws CorruptedOmemoKeyException if the OMEMO key is corrupted.
|
||||
* @throws NoRawSessionException when no double ratchet session was found.
|
||||
* @throws CryptoFailedException
|
||||
* @throws UntrustedOmemoIdentityException
|
||||
* @throws IOException
|
||||
* @throws CryptoFailedException if the OMEMO cryptography failed.
|
||||
* @throws UntrustedOmemoIdentityException if the OMEMO identity is not trusted.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract byte[] doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey)
|
||||
throws CorruptedOmemoKeyException, NoRawSessionException, CryptoFailedException,
|
||||
|
@ -88,7 +88,7 @@ public abstract class OmemoRatchet<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @return tuple of cipher generated from the unpacked message key and the auth-tag
|
||||
* @throws CryptoFailedException if decryption using the double ratchet fails
|
||||
* @throws NoRawSessionException if we have no session, but the element was NOT a PreKeyMessage
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
CipherAndAuthTag retrieveMessageKeyAndAuthTag(OmemoDevice sender, OmemoElement element) throws CryptoFailedException,
|
||||
NoRawSessionException, IOException {
|
||||
|
|
|
@ -231,13 +231,13 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Initialize OMEMO functionality for OmemoManager omemoManager.
|
||||
*
|
||||
* @param managerGuard OmemoManager we'd like to initialize.
|
||||
* @throws InterruptedException
|
||||
* @throws CorruptedOmemoKeyException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws CorruptedOmemoKeyException if the OMEMO key is corrupted.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
void init(OmemoManager.LoggedInOmemoManager managerGuard)
|
||||
throws InterruptedException, CorruptedOmemoKeyException, XMPPException.XMPPErrorException,
|
||||
|
@ -272,12 +272,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param contactsDevice OmemoDevice of the contact
|
||||
* @return ratchet update message
|
||||
* @throws NoSuchAlgorithmException if AES algorithms are not supported on this system.
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws CorruptedOmemoKeyException if our IdentityKeyPair is corrupted.
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws CannotEstablishOmemoSessionException if session negotiation fails.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoElement createRatchetUpdateElement(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
OmemoDevice contactsDevice)
|
||||
|
@ -334,12 +334,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param iv iv to be used with the messageKey
|
||||
* @return OmemoMessage object which contains the OmemoElement and some information.
|
||||
*
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws UndecidedOmemoIdentityException if the list of recipient devices contains undecided devices
|
||||
* @throws CryptoFailedException if we are lacking some crypto primitives
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private OmemoMessage.Sent encrypt(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
Set<OmemoDevice> contactsDevices,
|
||||
|
@ -441,7 +441,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @throws CorruptedOmemoKeyException if the identityKey of the sender is damaged.
|
||||
* @throws CryptoFailedException if decryption fails.
|
||||
* @throws NoRawSessionException if we have no session with the device and it sent a normal (non-preKey) message.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoMessage.Received decryptMessage(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
BareJid senderJid,
|
||||
|
@ -488,14 +488,14 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param contactsDevices set of recipient devices.
|
||||
* @param key AES-Key to be transported.
|
||||
* @param iv initialization vector to be used with the key.
|
||||
* @return KeyTransportElement
|
||||
* @return KeyTransportElement TODO javadoc me please
|
||||
*
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws UndecidedOmemoIdentityException if the list of recipients contains an undecided device
|
||||
* @throws CryptoFailedException if we are lacking some cryptographic algorithms
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoMessage.Sent createKeyTransportElement(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
Set<OmemoDevice> contactsDevices,
|
||||
|
@ -514,12 +514,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param message message we want to send
|
||||
* @return encrypted OmemoMessage
|
||||
*
|
||||
* @throws InterruptedException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws UndecidedOmemoIdentityException if the list of recipient devices contains an undecided device.
|
||||
* @throws CryptoFailedException if we are lacking some cryptographic algorithms
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoMessage.Sent createOmemoMessage(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
Set<OmemoDevice> contactsDevices,
|
||||
|
@ -546,12 +546,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param contactsDevice device of which we want to retrieve the bundle.
|
||||
* @return OmemoBundle of the device or null, if it doesn't exist.
|
||||
*
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws PubSubException.NotAPubSubNodeException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws PubSubException.NotAPubSubNodeException if a involved node is not a PubSub node.
|
||||
*/
|
||||
private static OmemoBundleElement fetchBundle(XMPPConnection connection,
|
||||
OmemoDevice contactsDevice)
|
||||
|
@ -579,11 +579,11 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param connection our connection.
|
||||
* @param userDevice our device
|
||||
* @param bundle the bundle we want to publish
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws NotALeafNodeException
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
*/
|
||||
static void publishBundle(XMPPConnection connection, OmemoDevice userDevice, OmemoBundleElement bundle)
|
||||
throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException,
|
||||
|
@ -598,12 +598,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param connection authenticated XMPP connection.
|
||||
* @param contact BareJid of the contact of which we want to retrieve the device list from.
|
||||
* @return
|
||||
* @throws InterruptedException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws PubSubException.NotAPubSubNodeException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws PubSubException.NotAPubSubNodeException if a involved node is not a PubSub node.
|
||||
*/
|
||||
private static OmemoDeviceListElement fetchDeviceList(XMPPConnection connection, BareJid contact)
|
||||
throws InterruptedException, PubSubException.NotALeafNodeException, SmackException.NoResponseException,
|
||||
|
@ -630,11 +630,11 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Publish the given device list to the server.
|
||||
* @param connection authenticated XMPP connection.
|
||||
* @param deviceList users deviceList.
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
*/
|
||||
static void publishDeviceList(XMPPConnection connection, OmemoDeviceListElement deviceList)
|
||||
throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException,
|
||||
|
@ -645,14 +645,14 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
|
||||
/**
|
||||
*
|
||||
* @param connection
|
||||
* @param userDevice
|
||||
* @throws InterruptedException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @param connection TODO javadoc me please
|
||||
* @param userDevice TODO javadoc me please
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private void refreshAndRepublishDeviceList(XMPPConnection connection, OmemoDevice userDevice)
|
||||
throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
|
||||
|
@ -693,9 +693,9 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Add our load the deviceList of the user from cache, delete stale devices if needed, add the users device
|
||||
* back if necessary, store the refurbished list in cache and return it.
|
||||
*
|
||||
* @param userDevice
|
||||
* @param userDevice TODO javadoc me please
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoCachedDeviceList cleanUpDeviceList(OmemoDevice userDevice) throws IOException {
|
||||
OmemoCachedDeviceList cachedDeviceList;
|
||||
|
@ -725,12 +725,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param contact contact we want to fetch the deviceList from
|
||||
* @return cached device list after refresh.
|
||||
*
|
||||
* @throws InterruptedException
|
||||
* @throws PubSubException.NotALeafNodeException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws PubSubException.NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoCachedDeviceList refreshDeviceList(XMPPConnection connection, OmemoDevice userDevice, BareJid contact)
|
||||
throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
|
||||
|
@ -759,9 +759,9 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param userDevice our OmemoDevice
|
||||
* @param contactsDevice OmemoDevice of a contact.
|
||||
* @throws CannotEstablishOmemoSessionException if we cannot establish a session (because of missing bundle etc.)
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws CorruptedOmemoKeyException if our IdentityKeyPair is corrupted.
|
||||
*/
|
||||
void buildFreshSessionWithDevice(XMPPConnection connection, OmemoDevice userDevice, OmemoDevice contactsDevice)
|
||||
|
@ -799,10 +799,10 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param devices set of devices we may want to build a session with if necessary
|
||||
* @return set of all devices with sessions
|
||||
*
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private Set<OmemoDevice> buildMissingSessionsWithDevices(XMPPConnection connection,
|
||||
OmemoDevice userDevice,
|
||||
|
@ -841,7 +841,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param callback OmemoTrustCallback to query the trust decisions from
|
||||
* @param devices set of OmemoDevices
|
||||
* @return set of OmemoDevices which contains all devices from the set devices, which are undecided
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private Set<OmemoDevice> getUndecidedDevices(OmemoDevice userDevice, OmemoTrustCallback callback, Set<OmemoDevice> devices) throws IOException {
|
||||
Set<OmemoDevice> undecidedDevices = new HashSet<>();
|
||||
|
@ -872,7 +872,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contactsDevice OmemoDevice of the contact.
|
||||
* @return true if userDevice has session with contactsDevice.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) throws IOException {
|
||||
return getOmemoStoreBackend().loadRawSession(userDevice, contactsDevice) != null;
|
||||
|
@ -884,7 +884,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param omemoManager our OmemoManager
|
||||
* @param contactsBundle bundle of the contact
|
||||
* @param contactsDevice OmemoDevice of the contact
|
||||
* @throws CorruptedOmemoKeyException
|
||||
* @throws CorruptedOmemoKeyException if the OMEMO key is corrupted.
|
||||
*/
|
||||
protected abstract void processBundle(OmemoManager omemoManager,
|
||||
T_Bundle contactsBundle,
|
||||
|
@ -896,7 +896,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
*
|
||||
* @param userDevice our OmemoDevice
|
||||
* @return true if rotation is necessary
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private boolean shouldRotateSignedPreKey(OmemoDevice userDevice) throws IOException {
|
||||
if (!OmemoConfiguration.getRenewOldSignedPreKeys()) {
|
||||
|
@ -925,7 +925,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
*
|
||||
* @param userDevice our OmemoDevice
|
||||
* @return our altered deviceList with stale devices marked as inactive.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private OmemoCachedDeviceList deleteStaleDevices(OmemoDevice userDevice) throws IOException {
|
||||
OmemoCachedDeviceList deviceList = getOmemoStoreBackend().loadCachedDeviceList(userDevice);
|
||||
|
@ -945,7 +945,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param contact subjects BareJid.
|
||||
* @param contactsDeviceList subjects deviceList.
|
||||
* @return copy of subjects deviceList with stale devices marked as inactive.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private OmemoCachedDeviceList removeStaleDevicesFromDeviceList(OmemoDevice userDevice,
|
||||
BareJid contact,
|
||||
|
@ -1000,7 +1000,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param lastReceipt date of last received message from that device
|
||||
* @param maxAgeHours threshold
|
||||
*
|
||||
* @return staleness
|
||||
* @return staleness TODO javadoc me please
|
||||
*/
|
||||
static boolean isStale(OmemoDevice userDevice, OmemoDevice subject, Date lastReceipt, int maxAgeHours) {
|
||||
if (userDevice.equals(subject)) {
|
||||
|
@ -1042,7 +1042,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param managerGuard authenticated OmemoManager.
|
||||
* @param mamQuery Mam archive query
|
||||
* @return list of {@link MessageOrOmemoMessage}s.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
List<MessageOrOmemoMessage> decryptMamQueryResult(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
MamManager.MamQuery mamQuery) throws IOException {
|
||||
|
@ -1220,7 +1220,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* @param stanza stanza
|
||||
* @param managerGuard authenticated OmemoManager
|
||||
* @return decrypted OmemoMessage or null
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoMessage.Received decryptStanza(Stanza stanza, OmemoManager.LoggedInOmemoManager managerGuard) throws IOException {
|
||||
OmemoManager manager = managerGuard.get();
|
||||
|
@ -1301,7 +1301,7 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
*
|
||||
* @param managerGuard authenticated OmemoManager.
|
||||
* @param brokenDevice device which session broke.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private void repairBrokenSessionWithPreKeyMessage(OmemoManager.LoggedInOmemoManager managerGuard,
|
||||
OmemoDevice brokenDevice) throws IOException {
|
||||
|
@ -1325,16 +1325,16 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
|
||||
/**
|
||||
* Send an empty OMEMO message to contactsDevice in order to forward the ratchet.
|
||||
* @param managerGuard
|
||||
* @param contactsDevice
|
||||
* @param managerGuard TODO javadoc me please
|
||||
* @param contactsDevice TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException if our or their OMEMO key is corrupted.
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws NoSuchAlgorithmException if AES encryption fails
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws CryptoFailedException if encryption fails (should not happen though, but who knows...)
|
||||
* @throws CannotEstablishOmemoSessionException if we cannot establish a session with contactsDevice.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private void sendRatchetUpdate(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice contactsDevice)
|
||||
throws CorruptedOmemoKeyException, InterruptedException, SmackException.NoResponseException,
|
||||
|
@ -1374,12 +1374,12 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Publish a new DeviceList with just our device in it.
|
||||
*
|
||||
* @param managerGuard authenticated OmemoManager.
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException.XMPPErrorException
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws NotALeafNodeException
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
* @throws NotALeafNodeException if a PubSub leaf node operation was attempted on a non-leaf node.
|
||||
*/
|
||||
public void purgeDeviceList(OmemoManager.LoggedInOmemoManager managerGuard)
|
||||
throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException,
|
||||
|
|
|
@ -79,7 +79,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our current device.
|
||||
* @param id deviceId to check for.
|
||||
* @return true if list did not contain our id, else false
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
boolean isAvailableDeviceId(OmemoDevice userDevice, int id) throws IOException {
|
||||
LOGGER.log(Level.INFO, "Check if id " + id + " is available...");
|
||||
|
@ -103,7 +103,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contact Contact we received the list from.
|
||||
* @param list List we received.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoCachedDeviceList mergeCachedDeviceList(OmemoDevice userDevice, BareJid contact, OmemoDeviceListElement list) throws IOException {
|
||||
OmemoCachedDeviceList cached = loadCachedDeviceList(userDevice, contact);
|
||||
|
@ -134,7 +134,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @throws CorruptedOmemoKeyException when our identityKey is invalid.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
* @throws IllegalStateException when our IdentityKeyPair is null.
|
||||
*/
|
||||
void changeSignedPreKey(OmemoDevice userDevice)
|
||||
|
@ -163,7 +163,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* Remove the oldest signedPreKey until there are only MAX_NUMBER_OF_STORED_SIGNED_PREKEYS left.
|
||||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
private void removeOldSignedPreKeys(OmemoDevice userDevice) throws IOException {
|
||||
if (OmemoConfiguration.getMaxNumberOfStoredSignedPreKeys() <= 0) {
|
||||
|
@ -184,9 +184,9 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* Pack a OmemoBundleElement containing our key material.
|
||||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @return OmemoBundleElement
|
||||
* @return OmemoBundleElement TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException when a key could not be loaded
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
OmemoBundleElement_VAxolotl packOmemoBundle(OmemoDevice userDevice)
|
||||
throws CorruptedOmemoKeyException, IOException {
|
||||
|
@ -205,9 +205,9 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
|
||||
/**
|
||||
* Replenish our supply of keys. If we are missing any type of keys, generate them fresh.
|
||||
* @param userDevice
|
||||
* @throws CorruptedOmemoKeyException
|
||||
* @throws IOException
|
||||
* @param userDevice TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException if the OMEMO key is corrupted.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public void replenishKeys(OmemoDevice userDevice)
|
||||
throws CorruptedOmemoKeyException, IOException {
|
||||
|
@ -238,7 +238,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
/**
|
||||
* Generate a new IdentityKeyPair. We should always have only one pair and usually keep this for a long time.
|
||||
*
|
||||
* @return identityKeyPair
|
||||
* @return identityKeyPair TODO javadoc me please
|
||||
*/
|
||||
public T_IdKeyPair generateOmemoIdentityKeyPair() {
|
||||
return keyUtil().generateOmemoIdentityKeyPair();
|
||||
|
@ -249,9 +249,9 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* Return null, if we have no identityKeyPair.
|
||||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @return identityKeyPair
|
||||
* @return identityKeyPair TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException Thrown, if the stored key is damaged (*hands up* not my fault!)
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract T_IdKeyPair loadOmemoIdentityKeyPair(OmemoDevice userDevice)
|
||||
throws CorruptedOmemoKeyException, IOException;
|
||||
|
@ -262,7 +262,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @param identityKeyPair identityKeyPair
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeOmemoIdentityKeyPair(OmemoDevice userDevice, T_IdKeyPair identityKeyPair) throws IOException;
|
||||
|
||||
|
@ -277,9 +277,9 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @param contactsDevice the device of which we want to load the identityKey.
|
||||
* @return identityKey
|
||||
* @return identityKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException when the key in question is corrupted and cant be deserialized.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract T_IdKey loadOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice)
|
||||
throws CorruptedOmemoKeyException, IOException;
|
||||
|
@ -290,7 +290,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contactsDevice device.
|
||||
* @param contactsKey identityKey belonging to the contactsDevice.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeOmemoIdentityKey(OmemoDevice userDevice, OmemoDevice contactsDevice, T_IdKey contactsKey) throws IOException;
|
||||
|
||||
|
@ -309,7 +309,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our omemoDevice.
|
||||
* @param contactsDevice device of which we want to set the message counter.
|
||||
* @param counter counter value.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeOmemoMessageCounter(OmemoDevice userDevice, OmemoDevice contactsDevice, int counter) throws IOException;
|
||||
|
||||
|
@ -321,7 +321,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our omemoDevice
|
||||
* @param contactsDevice device of which we want to get the message counter.
|
||||
* @return counter value.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract int loadOmemoMessageCounter(OmemoDevice userDevice, OmemoDevice contactsDevice) throws IOException;
|
||||
|
||||
|
@ -331,7 +331,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice omemoManager of our device.
|
||||
* @param contactsDevice device in question
|
||||
* @param date date of the last received message
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void setDateOfLastReceivedMessage(OmemoDevice userDevice, OmemoDevice contactsDevice, Date date) throws IOException;
|
||||
|
||||
|
@ -341,7 +341,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contactsDevice device in question
|
||||
* @return date if existent, null
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract Date getDateOfLastReceivedMessage(OmemoDevice userDevice, OmemoDevice contactsDevice) throws IOException;
|
||||
|
||||
|
@ -352,7 +352,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice
|
||||
* @param contactsDevice OmemoDevice in question
|
||||
* @param date date of the last publication after not being published
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void setDateOfLastDeviceIdPublication(OmemoDevice userDevice, OmemoDevice contactsDevice, Date date) throws IOException;
|
||||
|
||||
|
@ -363,7 +363,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice
|
||||
* @param contactsDevice OmemoDevice in question
|
||||
* @return date of the last publication after not being published
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract Date getDateOfLastDeviceIdPublication(OmemoDevice userDevice, OmemoDevice contactsDevice) throws IOException;
|
||||
|
||||
|
@ -372,7 +372,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @param date date
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void setDateOfLastSignedPreKeyRenewal(OmemoDevice userDevice, Date date) throws IOException;
|
||||
|
||||
|
@ -381,7 +381,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @return date if existent, otherwise null
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract Date getDateOfLastSignedPreKeyRenewal(OmemoDevice userDevice) throws IOException;
|
||||
|
||||
|
@ -403,7 +403,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param preKeyId id of the key to be loaded
|
||||
* @return loaded preKey
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract T_PreKey loadOmemoPreKey(OmemoDevice userDevice, int preKeyId) throws IOException;
|
||||
|
||||
|
@ -413,7 +413,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param preKeyId id of the key
|
||||
* @param preKey key
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeOmemoPreKey(OmemoDevice userDevice, int preKeyId, T_PreKey preKey) throws IOException;
|
||||
|
||||
|
@ -422,7 +422,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @param preKeyHashMap HashMap of preKeys
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public void storeOmemoPreKeys(OmemoDevice userDevice, TreeMap<Integer, T_PreKey> preKeyHashMap) throws IOException {
|
||||
for (Map.Entry<Integer, T_PreKey> entry : preKeyHashMap.entrySet()) {
|
||||
|
@ -444,7 +444,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @return Map containing our preKeys
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract TreeMap<Integer, T_PreKey> loadOmemoPreKeys(OmemoDevice userDevice) throws IOException;
|
||||
|
||||
|
@ -453,8 +453,8 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @param signedPreKeyId id of the key
|
||||
* @return key
|
||||
* @throws IOException
|
||||
* @return key TODO javadoc me please
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract T_SigPreKey loadOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId) throws IOException;
|
||||
|
||||
|
@ -467,7 +467,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param userDevice our OmemoDevice.
|
||||
* @return HashMap of our singedPreKeys
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract TreeMap<Integer, T_SigPreKey> loadOmemoSignedPreKeys(OmemoDevice userDevice) throws IOException;
|
||||
|
||||
|
@ -476,7 +476,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param identityKeyPair identityKeyPair used to sign the preKey
|
||||
* @param signedPreKeyId id that the preKey will have
|
||||
* @return signedPreKey
|
||||
* @return signedPreKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException when something goes wrong
|
||||
*/
|
||||
public T_SigPreKey generateOmemoSignedPreKey(T_IdKeyPair identityKeyPair, int signedPreKeyId)
|
||||
|
@ -490,7 +490,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param signedPreKeyId id of the signedPreKey
|
||||
* @param signedPreKey the key itself
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeOmemoSignedPreKey(OmemoDevice userDevice, int signedPreKeyId, T_SigPreKey signedPreKey) throws IOException;
|
||||
|
||||
|
@ -508,7 +508,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contactsDevice device whose session we want to load
|
||||
* @return crypto related session
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract T_Sess loadRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice) throws IOException;
|
||||
|
||||
|
@ -518,7 +518,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contact BareJid of the contact we want to get all sessions from
|
||||
* @return TreeMap of deviceId and sessions of the contact
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract HashMap<Integer, T_Sess> loadAllRawSessionsOf(OmemoDevice userDevice, BareJid contact) throws IOException;
|
||||
|
||||
|
@ -528,7 +528,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contactsDevice OmemoDevice whose session we want to store
|
||||
* @param session session
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeRawSession(OmemoDevice userDevice, OmemoDevice contactsDevice, T_Sess session) throws IOException;
|
||||
|
||||
|
@ -564,15 +564,16 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contact contact we want to get the deviceList of
|
||||
* @return CachedDeviceList of the contact
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract OmemoCachedDeviceList loadCachedDeviceList(OmemoDevice userDevice, BareJid contact) throws IOException;
|
||||
|
||||
/**
|
||||
* Load a list of deviceIds from our own devices.
|
||||
* @param userDevice
|
||||
* @return
|
||||
* @throws IOException
|
||||
*
|
||||
* @param userDevice TODO javadoc me please
|
||||
* @return the cached OMEMO device list.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public OmemoCachedDeviceList loadCachedDeviceList(OmemoDevice userDevice) throws IOException {
|
||||
return loadCachedDeviceList(userDevice, userDevice.getJid());
|
||||
|
@ -585,7 +586,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param userDevice our OmemoDevice.
|
||||
* @param contact Contact
|
||||
* @param contactsDeviceList list of the contacts devices' ids.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public abstract void storeCachedDeviceList(OmemoDevice userDevice,
|
||||
BareJid contact,
|
||||
|
@ -612,7 +613,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @return fingerprint of our identityKeyPair
|
||||
*
|
||||
* @throws CorruptedOmemoKeyException if the identityKey of userDevice is corrupted.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public OmemoFingerprint getFingerprint(OmemoDevice userDevice)
|
||||
throws CorruptedOmemoKeyException, IOException {
|
||||
|
@ -633,7 +634,7 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @return fingerprint of the userDevices IdentityKey.
|
||||
* @throws CorruptedOmemoKeyException if the IdentityKey is corrupted.
|
||||
* @throws NoIdentityKeyException if no IdentityKey for contactsDevice has been found locally.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public OmemoFingerprint getFingerprint(OmemoDevice userDevice, OmemoDevice contactsDevice)
|
||||
throws CorruptedOmemoKeyException, NoIdentityKeyException, IOException {
|
||||
|
@ -651,15 +652,15 @@ public abstract class OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
*
|
||||
* @param managerGuard authenticated OmemoManager
|
||||
* @param contactsDevice OmemoDevice we want to get the fingerprint from
|
||||
* @return fingerprint
|
||||
* @return fingerprint TODO javadoc me please
|
||||
*
|
||||
* @throws CannotEstablishOmemoSessionException If we have no local copy of the identityKey of the contact
|
||||
* and are unable to build a fresh session
|
||||
* @throws CorruptedOmemoKeyException If the identityKey we have of the contact is corrupted
|
||||
* @throws SmackException.NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException.NoResponseException
|
||||
* @throws IOException
|
||||
* @throws SmackException.NotConnectedException if the XMPP connection is not connected.
|
||||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
* @throws SmackException.NoResponseException if there was no response from the remote entity.
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public OmemoFingerprint getFingerprintAndMaybeBuildSession(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice contactsDevice)
|
||||
throws CannotEstablishOmemoSessionException, CorruptedOmemoKeyException,
|
||||
|
|
|
@ -158,7 +158,7 @@ public abstract class OmemoBundleElement implements ExtensionElement {
|
|||
* Return the HashMap of preKeys in the bundle.
|
||||
* The map uses the preKeys ids as key and the preKeys as value.
|
||||
*
|
||||
* @return preKeys
|
||||
* @return preKeys TODO javadoc me please
|
||||
*/
|
||||
public HashMap<Integer, byte[]> getPreKeys() {
|
||||
if (preKeys == null) {
|
||||
|
|
|
@ -55,7 +55,7 @@ public abstract class OmemoElement implements ExtensionElement {
|
|||
/**
|
||||
* Return the payload of the message.
|
||||
*
|
||||
* @return payload
|
||||
* @return payload TODO javadoc me please
|
||||
*/
|
||||
public byte[] getPayload() {
|
||||
if (payload == null) {
|
||||
|
|
|
@ -79,7 +79,7 @@ public class CannotEstablishOmemoSessionException extends Exception {
|
|||
/**
|
||||
* Return true, if there is at least one recipient, which would not be able to decipher the message on any of
|
||||
* their devices.
|
||||
* @return boolean
|
||||
* @return boolean TODO javadoc me please
|
||||
*/
|
||||
public boolean requiresThrowing() {
|
||||
for (Map.Entry<BareJid, HashMap<OmemoDevice, Throwable>> entry : failures.entrySet()) {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class ReadOnlyDeviceException extends Exception {
|
|||
|
||||
/**
|
||||
* Return the device in question.
|
||||
* @return device
|
||||
* @return device TODO javadoc me please
|
||||
*/
|
||||
public OmemoDevice getDevice() {
|
||||
return device;
|
||||
|
|
|
@ -31,8 +31,8 @@ public class StaleDeviceException extends Exception {
|
|||
* This exception gets thrown if a message cannot be encrypted for a device due to the device being inactive for too long (stale).
|
||||
*
|
||||
* @param device OmemoDevice.
|
||||
* @param lastMessageDate
|
||||
* @param lastDeviceIdPublicationDate
|
||||
* @param lastMessageDate TODO javadoc me please
|
||||
* @param lastDeviceIdPublicationDate TODO javadoc me please
|
||||
*/
|
||||
public StaleDeviceException(OmemoDevice device, Date lastMessageDate, Date lastDeviceIdPublicationDate) {
|
||||
this.device = device;
|
||||
|
|
|
@ -65,7 +65,8 @@ public class UntrustedOmemoIdentityException extends Exception {
|
|||
/**
|
||||
* Return the fingerprint of the key we expected.
|
||||
* This might return null in case this exception got thrown during encryption process.
|
||||
* @return
|
||||
*
|
||||
* @return the trusted fingerprint.
|
||||
*/
|
||||
public OmemoFingerprint getTrustedFingerprint() {
|
||||
return trustedKey;
|
||||
|
@ -73,7 +74,8 @@ public class UntrustedOmemoIdentityException extends Exception {
|
|||
|
||||
/**
|
||||
* Return the fingerprint of the unexpected untrusted key.
|
||||
* @return
|
||||
*
|
||||
* @return the OMEMO fingerprint.
|
||||
*/
|
||||
public OmemoFingerprint getUntrustedFingerprint() {
|
||||
return untrustedKey;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class CiphertextTuple {
|
|||
/**
|
||||
* Return the ciphertext.
|
||||
*
|
||||
* @return ciphertext
|
||||
* @return ciphertext TODO javadoc me please
|
||||
*/
|
||||
public byte[] getCiphertext() {
|
||||
return ciphertext;
|
||||
|
@ -50,7 +50,7 @@ public class CiphertextTuple {
|
|||
/**
|
||||
* Return the messageType.
|
||||
*
|
||||
* @return messageType
|
||||
* @return messageType TODO javadoc me please
|
||||
*/
|
||||
public int getMessageType() {
|
||||
return this.messageType;
|
||||
|
|
|
@ -43,7 +43,7 @@ public class OmemoDevice {
|
|||
/**
|
||||
* Return the BareJid of the device owner.
|
||||
*
|
||||
* @return bareJid
|
||||
* @return bareJid TODO javadoc me please
|
||||
*/
|
||||
public BareJid getJid() {
|
||||
return this.jid;
|
||||
|
@ -52,7 +52,7 @@ public class OmemoDevice {
|
|||
/**
|
||||
* Return the OMEMO device Id of the device.
|
||||
*
|
||||
* @return deviceId
|
||||
* @return deviceId TODO javadoc me please
|
||||
*/
|
||||
public int getDeviceId() {
|
||||
return this.deviceId;
|
||||
|
|
|
@ -55,7 +55,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Extract an IdentityKey from a OmemoBundleElement.
|
||||
*
|
||||
* @param bundle OmemoBundleElement
|
||||
* @return identityKey
|
||||
* @return identityKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException if the key is damaged/malformed
|
||||
*/
|
||||
public T_IdKey identityKey(OmemoBundleElement bundle) throws CorruptedOmemoKeyException {
|
||||
|
@ -66,7 +66,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Extract a signedPreKey from an OmemoBundleElement.
|
||||
*
|
||||
* @param bundle OmemoBundleElement
|
||||
* @return singedPreKey
|
||||
* @return singedPreKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException if the key is damaged/malformed
|
||||
*/
|
||||
public T_ECPub signedPreKeyPublic(OmemoBundleElement bundle) throws CorruptedOmemoKeyException {
|
||||
|
@ -77,7 +77,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Extract the id of the transported signedPreKey from the bundle.
|
||||
*
|
||||
* @param bundle OmemoBundleElement
|
||||
* @return signedPreKeyId
|
||||
* @return signedPreKeyId TODO javadoc me please
|
||||
*/
|
||||
public int signedPreKeyId(OmemoBundleElement bundle) {
|
||||
return bundle.getSignedPreKeyId();
|
||||
|
@ -87,7 +87,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Extract the signature of the signedPreKey in the bundle as a byte array.
|
||||
*
|
||||
* @param bundle OmemoBundleElement
|
||||
* @return signature
|
||||
* @return signature TODO javadoc me please
|
||||
*/
|
||||
public byte[] signedPreKeySignature(OmemoBundleElement bundle) {
|
||||
return bundle.getSignedPreKeySignature();
|
||||
|
@ -153,7 +153,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Serialize an identityKey into bytes.
|
||||
*
|
||||
* @param identityKey idKey
|
||||
* @return bytes
|
||||
* @return bytes TODO javadoc me please
|
||||
*/
|
||||
public abstract byte[] identityKeyToBytes(T_IdKey identityKey);
|
||||
|
||||
|
@ -170,7 +170,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Deserialize a public preKey from bytes.
|
||||
*
|
||||
* @param data preKey as bytes
|
||||
* @return preKey
|
||||
* @return preKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException if the key is damaged or malformed
|
||||
*/
|
||||
public T_ECPub preKeyPublicFromBytes(byte[] data) throws CorruptedOmemoKeyException {
|
||||
|
@ -209,7 +209,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
*
|
||||
* @param identityKeyPair identityKeyPair used to sign the preKey
|
||||
* @param signedPreKeyId id that the preKey will have
|
||||
* @return signedPreKey
|
||||
* @return signedPreKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException when the identityKeyPair is invalid
|
||||
*/
|
||||
public abstract T_SigPreKey generateOmemoSignedPreKey(T_IdKeyPair identityKeyPair, int signedPreKeyId) throws CorruptedOmemoKeyException;
|
||||
|
@ -219,7 +219,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
* Deserialize a public signedPreKey from bytes.
|
||||
*
|
||||
* @param data bytes
|
||||
* @return signedPreKey
|
||||
* @return signedPreKey TODO javadoc me please
|
||||
* @throws CorruptedOmemoKeyException if the key is damaged or malformed
|
||||
*/
|
||||
public T_ECPub signedPreKeyPublicFromBytes(byte[] data) throws CorruptedOmemoKeyException {
|
||||
|
@ -267,7 +267,7 @@ public abstract class OmemoKeyUtil<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
|||
/**
|
||||
* Generate a new IdentityKeyPair. We should always have only one pair and usually keep this for a long time.
|
||||
*
|
||||
* @return identityKeyPair
|
||||
* @return identityKeyPair TODO javadoc me please
|
||||
*/
|
||||
public abstract T_IdKeyPair generateOmemoIdentityKeyPair();
|
||||
|
||||
|
|
|
@ -91,12 +91,12 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param iv initialization vector used for message encryption
|
||||
* @param message message we want to send
|
||||
*
|
||||
* @throws NoSuchPaddingException
|
||||
* @throws BadPaddingException
|
||||
* @throws InvalidKeyException
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws IllegalBlockSizeException
|
||||
* @throws InvalidAlgorithmParameterException
|
||||
* @throws NoSuchPaddingException if the requested padding mechanism is not availble.
|
||||
* @throws BadPaddingException if the input data is not padded properly.
|
||||
* @throws InvalidKeyException if the key is invalid.
|
||||
* @throws NoSuchAlgorithmException if no such algorithm is available.
|
||||
* @throws IllegalBlockSizeException if the input data length is incorrect.
|
||||
* @throws InvalidAlgorithmParameterException if the provided arguments are invalid.
|
||||
*/
|
||||
public OmemoMessageBuilder(OmemoDevice userDevice,
|
||||
OmemoTrustCallback callback,
|
||||
|
@ -123,13 +123,13 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param ratchet our OmemoRatchet
|
||||
* @param message message we want to send
|
||||
*
|
||||
* @throws NoSuchPaddingException
|
||||
* @throws BadPaddingException
|
||||
* @throws InvalidKeyException
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws IllegalBlockSizeException
|
||||
* @throws UnsupportedEncodingException
|
||||
* @throws InvalidAlgorithmParameterException
|
||||
* @throws NoSuchPaddingException if the requested padding mechanism is not availble.
|
||||
* @throws BadPaddingException if the input data is not padded properly.
|
||||
* @throws InvalidKeyException if the key is invalid.
|
||||
* @throws NoSuchAlgorithmException if no such algorithm is available.
|
||||
* @throws IllegalBlockSizeException if the input data length is incorrect.
|
||||
* @throws UnsupportedEncodingException if the encoding is not supported.
|
||||
* @throws InvalidAlgorithmParameterException if the provided arguments are invalid.
|
||||
*/
|
||||
public OmemoMessageBuilder(OmemoDevice userDevice,
|
||||
OmemoTrustCallback callback,
|
||||
|
@ -147,12 +147,12 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @see <a href="https://conversations.im/omemo/audit.pdf">OMEMO security audit</a>.
|
||||
*
|
||||
* @param message plaintext message
|
||||
* @throws NoSuchPaddingException
|
||||
* @throws NoSuchPaddingException if the requested padding mechanism is not availble.
|
||||
* @throws NoSuchProviderException
|
||||
* @throws InvalidAlgorithmParameterException
|
||||
* @throws InvalidKeyException
|
||||
* @throws BadPaddingException
|
||||
* @throws IllegalBlockSizeException
|
||||
* @throws InvalidAlgorithmParameterException if the provided arguments are invalid.
|
||||
* @throws InvalidKeyException if the key is invalid.
|
||||
* @throws BadPaddingException if the input data is not padded properly.
|
||||
* @throws IllegalBlockSizeException if the input data length is incorrect.
|
||||
*/
|
||||
private void setMessage(String message)
|
||||
throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException,
|
||||
|
@ -220,7 +220,7 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @throws CorruptedOmemoKeyException if the identityKey of that device is corrupted.
|
||||
* @throws UndecidedOmemoIdentityException if the user hasn't yet decided whether to trust that device or not.
|
||||
* @throws UntrustedOmemoIdentityException if the user has decided not to trust that device.
|
||||
* @throws IOException
|
||||
* @throws IOException if an I/O error occured.
|
||||
*/
|
||||
public void addRecipient(OmemoDevice contactsDevice)
|
||||
throws NoIdentityKeyException, CorruptedOmemoKeyException, UndecidedOmemoIdentityException,
|
||||
|
@ -248,7 +248,7 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
/**
|
||||
* Assemble an OmemoMessageElement from the current state of the builder.
|
||||
*
|
||||
* @return OmemoMessageElement
|
||||
* @return OmemoMessageElement TODO javadoc me please
|
||||
*/
|
||||
public OmemoElement finish() {
|
||||
OmemoHeaderElement_VAxolotl header = new OmemoHeaderElement_VAxolotl(
|
||||
|
@ -265,7 +265,7 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @param keyType Key Type
|
||||
* @param keyLength Key Length in bit
|
||||
* @return new AES key
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws NoSuchAlgorithmException if no such algorithm is available.
|
||||
*/
|
||||
public static byte[] generateKey(String keyType, int keyLength) throws NoSuchAlgorithmException {
|
||||
KeyGenerator generator = KeyGenerator.getInstance(keyType);
|
||||
|
@ -276,7 +276,7 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
/**
|
||||
* Generate a 16 byte initialization vector for AES encryption.
|
||||
*
|
||||
* @return iv
|
||||
* @return iv TODO javadoc me please
|
||||
*/
|
||||
public static byte[] generateIv() {
|
||||
SecureRandom random = new SecureRandom();
|
||||
|
|
|
@ -47,7 +47,7 @@ public class OmemoServiceTest extends SmackTestSuite {
|
|||
|
||||
/**
|
||||
* Test correct functionality of isStale method.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException if the provided string is invalid.
|
||||
*/
|
||||
@Test
|
||||
public void isStaleDeviceTest() throws XmppStringprepException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue