Struct vodozemac::ecies::InitialMessage
source · pub struct InitialMessage {
pub public_key: Curve25519PublicKey,
pub ciphertext: Vec<u8>,
}
Expand description
The initial message, sent by the ECIES channel establisher.
This message embeds the public key of the message creator allowing the other side to establish a channel using this message.
This key is unauthenticated so authentication needs to happen out-of-band in order for the established channel to become secure.
Fields§
§public_key: Curve25519PublicKey
The ephemeral public key that was used to establish the ECIES channel.
ciphertext: Vec<u8>
The ciphertext of the initial message.
Implementations§
source§impl InitialMessage
impl InitialMessage
sourcepub fn encode(&self) -> String
pub fn encode(&self) -> String
Encode the message as a string.
The string will contain the base64-encoded Curve25519 public key and the
ciphertext of the message separated by a |
.
sourcepub fn decode(message: &str) -> Result<Self, MessageDecodeError>
pub fn decode(message: &str) -> Result<Self, MessageDecodeError>
Attempt do decode a string into a InitialMessage
.
Trait Implementations§
source§impl Debug for InitialMessage
impl Debug for InitialMessage
source§impl PartialEq for InitialMessage
impl PartialEq for InitialMessage
source§fn eq(&self, other: &InitialMessage) -> bool
fn eq(&self, other: &InitialMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for InitialMessage
impl StructuralPartialEq for InitialMessage
Auto Trait Implementations§
impl Freeze for InitialMessage
impl RefUnwindSafe for InitialMessage
impl Send for InitialMessage
impl Sync for InitialMessage
impl Unpin for InitialMessage
impl UnwindSafe for InitialMessage
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