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>
omemoManager, store
Modifier and Type | Method and 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.
|
public byte[] doubleRatchetDecrypt(OmemoDevice sender, byte[] encryptedKey) throws CorruptedOmemoKeyException, NoRawSessionException, CryptoFailedException, UntrustedOmemoIdentityException
OmemoRatchet
doubleRatchetDecrypt
in class 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>
sender
- sender of the message.encryptedKey
- key encrypted with the ratchet of the sender.CorruptedOmemoKeyException
NoRawSessionException
- when no double ratchet session was found.CryptoFailedException
UntrustedOmemoIdentityException
public CiphertextTuple doubleRatchetEncrypt(OmemoDevice recipient, byte[] messageKey)
OmemoRatchet
doubleRatchetEncrypt
in class 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>
recipient
- recipient of the message.messageKey
- key we want to encrypt.