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