Package org.jivesoftware.smackx.omemo
Class OmemoRatchet<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph>
java.lang.Object
org.jivesoftware.smackx.omemo.OmemoRatchet<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph>
- Direct Known Subclasses:
SignalOmemoRatchet
public abstract class OmemoRatchet<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph>
extends Object
-
Field Summary
Modifier and TypeFieldDescriptionprotected final OmemoManager
protected final OmemoStore<T_IdKeyPair,
T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> -
Constructor Summary
ConstructorDescriptionOmemoRatchet
(OmemoManager omemoManager, OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> store) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract byte[]
doubleRatchetDecrypt
(OmemoDevice sender, byte[] encryptedKey) Decrypt a double-ratchet-encrypted message key.abstract CiphertextTuple
doubleRatchetEncrypt
(OmemoDevice recipient, byte[] messageKey) Encrypt a messageKey with the double ratchet session of the recipient.
-
Field Details
-
omemoManager
-
store
protected final OmemoStore<T_IdKeyPair,T_IdKey, storeT_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph>
-
-
Constructor Details
-
OmemoRatchet
public OmemoRatchet(OmemoManager omemoManager, OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> store) Constructor.- Parameters:
omemoManager
- omemoManagerstore
- omemoStore
-
-
Method Details
-
doubleRatchetDecrypt
public abstract byte[] doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey) throws CorruptedOmemoKeyException, NoRawSessionException, CryptoFailedException, UntrustedOmemoIdentityException, IOException Decrypt a double-ratchet-encrypted message key.- Parameters:
sender
- sender of the message.encryptedKey
- key encrypted with the ratchet of the sender.- Returns:
- decrypted message key.
- Throws:
CorruptedOmemoKeyException
- if the OMEMO key is corrupted.NoRawSessionException
- when no double ratchet session was found.CryptoFailedException
- if the OMEMO cryptography failed.UntrustedOmemoIdentityException
- if the OMEMO identity is not trusted.IOException
- if an I/O error occurred.
-
doubleRatchetEncrypt
Encrypt a messageKey with the double ratchet session of the recipient.- Parameters:
recipient
- recipient of the message.messageKey
- key we want to encrypt.- Returns:
- encrypted message key.
-