Class SignalOmemoRatchet
- java.lang.Object
-
- org.jivesoftware.smackx.omemo.OmemoRatchet<org.whispersystems.libsignal.IdentityKeyPair,org.whispersystems.libsignal.IdentityKey,org.whispersystems.libsignal.state.PreKeyRecord,org.whispersystems.libsignal.state.SignedPreKeyRecord,org.whispersystems.libsignal.state.SessionRecord,org.whispersystems.libsignal.SignalProtocolAddress,org.whispersystems.libsignal.ecc.ECPublicKey,org.whispersystems.libsignal.state.PreKeyBundle,org.whispersystems.libsignal.SessionCipher>
-
- org.jivesoftware.smackx.omemo.signal.SignalOmemoRatchet
-
public class SignalOmemoRatchet extends OmemoRatchet<org.whispersystems.libsignal.IdentityKeyPair,org.whispersystems.libsignal.IdentityKey,org.whispersystems.libsignal.state.PreKeyRecord,org.whispersystems.libsignal.state.SignedPreKeyRecord,org.whispersystems.libsignal.state.SessionRecord,org.whispersystems.libsignal.SignalProtocolAddress,org.whispersystems.libsignal.ecc.ECPublicKey,org.whispersystems.libsignal.state.PreKeyBundle,org.whispersystems.libsignal.SessionCipher>
-
-
Field Summary
-
Fields inherited from class org.jivesoftware.smackx.omemo.OmemoRatchet
omemoManager, store
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey)
Decrypt a double-ratchet-encrypted message key.CiphertextTuple
doubleRatchetEncrypt(OmemoDevice recipient, byte[] messageKey)
Encrypt a messageKey with the double ratchet session of the recipient.
-
-
-
Method Detail
-
doubleRatchetDecrypt
public byte[] doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey) throws CorruptedOmemoKeyException, NoRawSessionException, CryptoFailedException, UntrustedOmemoIdentityException, IOException
Description copied from class:OmemoRatchet
Decrypt a double-ratchet-encrypted message key.- Specified by:
doubleRatchetDecrypt
in classOmemoRatchet<org.whispersystems.libsignal.IdentityKeyPair,org.whispersystems.libsignal.IdentityKey,org.whispersystems.libsignal.state.PreKeyRecord,org.whispersystems.libsignal.state.SignedPreKeyRecord,org.whispersystems.libsignal.state.SessionRecord,org.whispersystems.libsignal.SignalProtocolAddress,org.whispersystems.libsignal.ecc.ECPublicKey,org.whispersystems.libsignal.state.PreKeyBundle,org.whispersystems.libsignal.SessionCipher>
- 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
public CiphertextTuple doubleRatchetEncrypt(OmemoDevice recipient, byte[] messageKey)
Description copied from class:OmemoRatchet
Encrypt a messageKey with the double ratchet session of the recipient.- Specified by:
doubleRatchetEncrypt
in classOmemoRatchet<org.whispersystems.libsignal.IdentityKeyPair,org.whispersystems.libsignal.IdentityKey,org.whispersystems.libsignal.state.PreKeyRecord,org.whispersystems.libsignal.state.SignedPreKeyRecord,org.whispersystems.libsignal.state.SessionRecord,org.whispersystems.libsignal.SignalProtocolAddress,org.whispersystems.libsignal.ecc.ECPublicKey,org.whispersystems.libsignal.state.PreKeyBundle,org.whispersystems.libsignal.SessionCipher>
- Parameters:
recipient
- recipient of the message.messageKey
- key we want to encrypt.- Returns:
- encrypted message key.
-
-