diff options
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlService.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlService.java | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlService.java b/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlService.java index 987cf940..49cd6033 100644 --- a/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlService.java +++ b/src/main/java/de/thedevstack/conversationsplus/crypto/axolotl/AxolotlService.java @@ -9,6 +9,7 @@ import org.whispersystems.libaxolotl.state.PreKeyRecord; import org.whispersystems.libaxolotl.state.SignedPreKeyRecord; import java.security.cert.X509Certificate; +import java.util.List; import java.util.Set; import de.thedevstack.conversationsplus.entities.Account; @@ -30,6 +31,8 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded { String PEP_BUNDLES = PEP_PREFIX + ".bundles"; String PEP_VERIFICATION = PEP_PREFIX + ".verification"; + int NUM_KEYS_TO_PUBLISH = 100; + enum FetchStatus { PENDING, SUCCESS, @@ -38,15 +41,10 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded { ERROR } - boolean fetchMapHasErrors(Contact contact); - String getOwnFingerprint(); Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust); - Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust, Contact contact); - - long getNumTrustedKeys(Contact contact); Set<String> getFingerprintsForOwnSessions(); @@ -77,8 +75,6 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded { void publishBundlesIfNeeded(boolean announce, boolean wipe); - boolean isContactAxolotlCapable(Contact contact); - XmppAxolotlSession.Trust getFingerprintTrust(String fingerprint); X509Certificate getFingerprintCertificate(String fingerprint); @@ -87,24 +83,36 @@ public interface AxolotlService extends OnAdvancedStreamFeaturesLoaded { Set<AxolotlAddress> findDevicesWithoutSession(Conversation conversation); - Set<AxolotlAddress> findDevicesWithoutSession(Jid contactJid); - boolean createSessionsIfNeeded(Conversation conversation); boolean trustedSessionVerified(Conversation conversation); - boolean hasPendingKeyFetches(Account account, Contact contact); - @Nullable XmppAxolotlMessage encrypt(Message message); void preparePayloadMessage(Message message, boolean delay); - void prepareKeyTransportMessage(Contact contact, OnMessageCreatedCallback onMessageCreatedCallback); - XmppAxolotlMessage fetchAxolotlMessageFromCache(Message message); XmppAxolotlMessage.XmppAxolotlPlaintextMessage processReceivingPayloadMessage(XmppAxolotlMessage message); XmppAxolotlMessage.XmppAxolotlKeyTransportMessage processReceivingKeyTransportMessage(XmppAxolotlMessage message); + + boolean fetchMapHasErrors(List<Jid> jids); + + Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust, Jid jid); + + Set<IdentityKey> getKeysWithTrust(XmppAxolotlSession.Trust trust, List<Jid> jids); + + long getNumTrustedKeys(Jid jid); + + boolean anyTargetHasNoTrustedKeys(List<Jid> jids); + + boolean isConversationAxolotlCapable(Conversation conversation); + + List<Jid> getCryptoTargets(Conversation conversation); + + boolean hasPendingKeyFetches(Account account, List<Jid> jids); + + void prepareKeyTransportMessage(Conversation conversation, OnMessageCreatedCallback onMessageCreatedCallback); } |