Struct vodozemac::ecies::Ecies

source ·
pub struct Ecies { /* private fields */ }
Expand description

An unestablished ECIES session.

Implementations§

source§

impl Ecies

source

pub fn new() -> Self

Create a new, random, unestablished ECIES session.

This method will use the MATRIX_QR_CODE_LOGIN info. If you are using this for a different purpose, consider using the Ecies::with_info() method.

source

pub fn with_info(info: &str) -> Self

Create a new, random, unestablished ECIES session with the given application info.

The application info will be used to derive the various secrets and provide domain separation.

source

pub fn establish_outbound_channel( self, their_public_key: Curve25519PublicKey, initial_plaintext: &[u8], ) -> Result<OutboundCreationResult, Error>

Create an EstablishedEcies session using the other side’s Curve25519 public key and an initial plaintext.

After the channel has been established, we can encrypt messages to send to the other side. The other side uses the initial message to establishes the same channel on its side.

source

pub fn establish_inbound_channel( self, message: &InitialMessage, ) -> Result<InboundCreationResult, Error>

Create a EstablishedEcies from an InitialMessage encrypted by the other side.

source

pub fn public_key(&self) -> Curve25519PublicKey

Get our Curve25519PublicKey.

This public key needs to be sent to the other side to be able to establish an ECIES channel.

Auto Trait Implementations§

§

impl Freeze for Ecies

§

impl RefUnwindSafe for Ecies

§

impl Send for Ecies

§

impl Sync for Ecies

§

impl Unpin for Ecies

§

impl UnwindSafe for Ecies

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V