pub struct ServiceCipher<S> { /* private fields */ }
Expand description
Decrypts incoming messages and encrypts outgoing messages.
Equivalent of SignalServiceCipher in Java.
Implementations§
Source§impl<S> ServiceCipher<S>
impl<S> ServiceCipher<S>
pub fn new( protocol_store: S, trust_root: PublicKey, local_uuid: Uuid, local_device_id: u32, ) -> Self
Sourcepub async fn open_envelope<R: Rng + CryptoRng>(
&mut self,
envelope: Envelope,
csprng: &mut R,
) -> Result<Option<Content>, ServiceError>
pub async fn open_envelope<R: Rng + CryptoRng>( &mut self, envelope: Envelope, csprng: &mut R, ) -> Result<Option<Content>, ServiceError>
Opens (“decrypts”) an envelope.
Envelopes may be empty, in which case this method returns Ok(None)
Trait Implementations§
Source§impl<S: Clone> Clone for ServiceCipher<S>
impl<S: Clone> Clone for ServiceCipher<S>
Source§fn clone(&self) -> ServiceCipher<S>
fn clone(&self) -> ServiceCipher<S>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<S> Freeze for ServiceCipher<S>where
S: Freeze,
impl<S> RefUnwindSafe for ServiceCipher<S>where
S: RefUnwindSafe,
impl<S> Send for ServiceCipher<S>where
S: Send,
impl<S> Sync for ServiceCipher<S>where
S: Sync,
impl<S> Unpin for ServiceCipher<S>where
S: Unpin,
impl<S> UnwindSafe for ServiceCipher<S>where
S: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more