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 java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected OmemoManageromemoManagerprotected OmemoStore<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph>store
-
Constructor Summary
Constructors Constructor Description OmemoRatchet(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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract byte[]doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey)Decrypt a double-ratchet-encrypted message key.abstract CiphertextTupledoubleRatchetEncrypt(OmemoDevice recipient, byte[] messageKey)Encrypt a messageKey with the double ratchet session of the recipient.
-
-
-
Field Detail
-
omemoManager
protected final OmemoManager omemoManager
-
store
protected final OmemoStore<T_IdKeyPair,T_IdKey,T_PreKey,T_SigPreKey,T_Sess,T_Addr,T_ECPub,T_Bundle,T_Ciph> store
-
-
Constructor Detail
-
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 Detail
-
doubleRatchetDecrypt
public abstract byte[] doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey) throws CorruptedOmemoKeyException, NoRawSessionException, CryptoFailedException, UntrustedOmemoIdentityException, java.io.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.java.io.IOException- if an I/O error occurred.
-
doubleRatchetEncrypt
public abstract CiphertextTuple doubleRatchetEncrypt(OmemoDevice recipient, byte[] messageKey)
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.
-
-