vodozemac::ecies

Struct 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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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