pub struct SecretEncrypted<'a> {
pub kind: SecretEncKind,
pub enc_payload: &'a [u8],
pub enc_iv: &'a [u8],
pub target_message_key: &'a MessageKey,
}Expand description
A decryptable secret_encrypted_message envelope of any supported kind.
The general counterpart of EncryptedEdit: use extract_secret_encrypted
to obtain it, Self::original_sender_jid to resolve the targeted message’s
author, then decrypt_secret_encrypted with the parent’s messageSecret.
Fields§
§kind: SecretEncKind§enc_payload: &'a [u8]§enc_iv: &'a [u8]§target_message_key: &'a MessageKeyImplementations§
Source§impl<'a> SecretEncrypted<'a>
impl<'a> SecretEncrypted<'a>
pub fn target_id(&self) -> Option<&str>
Sourcepub fn original_sender_jid(&self, my_jid: &Jid) -> Result<Jid, MessageEditError>
pub fn original_sender_jid(&self, my_jid: &Jid) -> Result<Jid, MessageEditError>
Resolve the targeted message’s author from the target key alone.
See the caution on EncryptedEdit::original_sender_jid: for
MESSAGE_EDIT prefer Self::original_sender_for_dispatch on the receive
path. Authoritative for poll/event kinds (whose target key carries the
real author).
Sourcepub fn original_sender_for_dispatch(
&self,
is_from_me: bool,
envelope_sender: &Jid,
my_jid: &Jid,
) -> Result<Jid, MessageEditError>
pub fn original_sender_for_dispatch( &self, is_from_me: bool, envelope_sender: &Jid, my_jid: &Jid, ) -> Result<Jid, MessageEditError>
Resolve the parent message’s author for the secret lookup + HKDF info, using the dispatch-time envelope frame.
For MESSAGE_EDIT the editor is always the author (you can only edit
your own message) and target_message_key is written in the editor’s
frame — its from_me is true even for an incoming peer edit, so it is
not a reliable receiver-side signal. Take the author from the envelope
instead: ourselves for a self-synced edit, else the envelope sender.
Other kinds (poll/event) can be modified by a non-author, so for those
target_message_key stays authoritative.
Trait Implementations§
Source§impl<'a> Clone for SecretEncrypted<'a>
impl<'a> Clone for SecretEncrypted<'a>
Source§fn clone(&self) -> SecretEncrypted<'a>
fn clone(&self) -> SecretEncrypted<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for SecretEncrypted<'a>
Auto Trait Implementations§
impl<'a> Freeze for SecretEncrypted<'a>
impl<'a> RefUnwindSafe for SecretEncrypted<'a>
impl<'a> Send for SecretEncrypted<'a>
impl<'a> Sync for SecretEncrypted<'a>
impl<'a> Unpin for SecretEncrypted<'a>
impl<'a> UnsafeUnpin for SecretEncrypted<'a>
impl<'a> UnwindSafe for SecretEncrypted<'a>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more