pub struct InitiatorHandshake { /* private fields */ }Available on crate feature
crypto only.Expand description
Handshake state machine for the initiator (client).
Implementations§
Source§impl InitiatorHandshake
impl InitiatorHandshake
Sourcepub fn new(
local_keypair: &StaticKeypair,
remote_public: &[u8; 32],
) -> Result<Self, CryptoError>
pub fn new( local_keypair: &StaticKeypair, remote_public: &[u8; 32], ) -> Result<Self, CryptoError>
Create a new initiator handshake.
§Arguments
local_keypair- The initiator’s static keypairremote_public- The responder’s known static public key
Sourcepub fn write_message(&mut self, payload: &[u8]) -> Result<Vec<u8>, CryptoError>
pub fn write_message(&mut self, payload: &[u8]) -> Result<Vec<u8>, CryptoError>
Sourcepub fn read_message(
self,
message: &[u8],
) -> Result<(Vec<u8>, HandshakeResult), CryptoError>
pub fn read_message( self, message: &[u8], ) -> Result<(Vec<u8>, HandshakeResult), CryptoError>
Auto Trait Implementations§
impl Freeze for InitiatorHandshake
impl !RefUnwindSafe for InitiatorHandshake
impl Send for InitiatorHandshake
impl Sync for InitiatorHandshake
impl Unpin for InitiatorHandshake
impl !UnwindSafe for InitiatorHandshake
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