[−][src]Struct kuska_handshake::Handshake
The Handshake
type maintains the different states that happen in each step of the handshake,
allowing it to advance to completion.
The Handshake
follows the typestate pattern.
Fields
base: HandshakeBase
state: S
Implementations
impl Handshake<SendClientHello>
[src]
pub fn new_client(
net_id: Key,
pk: PublicKey,
sk: SecretKey
) -> Handshake<SendClientHello>
[src]
net_id: Key,
pk: PublicKey,
sk: SecretKey
) -> Handshake<SendClientHello>
Create a new handshake client that can send the client hello.
impl Handshake<SendClientHello>
[src]
pub fn send_client_hello(
self,
send_buf: &mut [u8]
) -> Handshake<RecvServerHello>
[src]
self,
send_buf: &mut [u8]
) -> Handshake<RecvServerHello>
Send a client hello and advance to the next client state.
pub const fn send_bytes(&self) -> usize
[src]
Number of bytes that will be written to the send_buf
in this state.
impl Handshake<RecvServerHello>
[src]
pub fn recv_server_hello(
self,
recv_buf: &[u8]
) -> Result<Handshake<SendClientAuth>, Error>
[src]
self,
recv_buf: &[u8]
) -> Result<Handshake<SendClientAuth>, Error>
Receive a server hello and advance to the next client state.
pub const fn recv_bytes(&self) -> usize
[src]
Number of bytes that will be read from the recv_buf
in this state.
impl Handshake<SendClientAuth>
[src]
pub fn send_client_auth(
self,
send_buf: &mut [u8],
server_pk: PublicKey
) -> Result<Handshake<RecvServerAccept>, Error>
[src]
self,
send_buf: &mut [u8],
server_pk: PublicKey
) -> Result<Handshake<RecvServerAccept>, Error>
Send a client auth and advance to the next client state.
pub const fn send_bytes(&self) -> usize
[src]
Number of bytes that will be written to the send_buf
in this state.
impl Handshake<RecvServerAccept>
[src]
pub fn recv_server_accept(
self,
recv_buf: &mut [u8]
) -> Result<Handshake<Complete>, Error>
[src]
self,
recv_buf: &mut [u8]
) -> Result<Handshake<Complete>, Error>
pub const fn recv_bytes(&self) -> usize
[src]
Number of bytes that will be read from the recv_buf
in this state.
impl Handshake<RecvClientHello>
[src]
pub fn new_server(
net_id: Key,
pk: PublicKey,
sk: SecretKey
) -> Handshake<RecvClientHello>
[src]
net_id: Key,
pk: PublicKey,
sk: SecretKey
) -> Handshake<RecvClientHello>
Create a new handshake server that can receive the client hello.
impl Handshake<RecvClientHello>
[src]
pub fn recv_client_hello(
self,
recv_buf: &[u8]
) -> Result<Handshake<SendServerHello>, Error>
[src]
self,
recv_buf: &[u8]
) -> Result<Handshake<SendServerHello>, Error>
Receive a client hello and advance to the next server state.
pub const fn recv_bytes(&self) -> usize
[src]
Number of bytes that will be read from the recv_buf
in this state.
impl Handshake<SendServerHello>
[src]
pub fn send_server_hello(self, send_buf: &mut [u8]) -> Handshake<RecvClientAuth>
[src]
Send a server hello and advance to the next server state.
pub const fn send_bytes(&self) -> usize
[src]
Number of bytes that will be written to the send_buf
in this state.
impl Handshake<RecvClientAuth>
[src]
pub fn recv_client_auth(
self,
recv_buf: &mut [u8]
) -> Result<Handshake<SendServerAccept>, Error>
[src]
self,
recv_buf: &mut [u8]
) -> Result<Handshake<SendServerAccept>, Error>
Receive a client auth and advance to the next server state.
pub const fn recv_bytes(&self) -> usize
[src]
Number of bytes that will be read from the recv_buf
in this state.
impl Handshake<SendServerAccept>
[src]
pub fn send_server_accept(self, send_buf: &mut [u8]) -> Handshake<Complete>
[src]
Send a server accept and advance to the next server state.
pub const fn send_bytes(&self) -> usize
[src]
Number of bytes that will be written to the send_buf
in this state.
impl Handshake<Complete>
[src]
pub fn complete(&self) -> HandshakeComplete
[src]
Create a HandshakeComplete
out of a Handshake
in the Complete
state.
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for Handshake<S> where
S: RefUnwindSafe,
[src]
S: RefUnwindSafe,
impl<S> Send for Handshake<S> where
S: Send,
[src]
S: Send,
impl<S> Sync for Handshake<S> where
S: Sync,
[src]
S: Sync,
impl<S> Unpin for Handshake<S> where
S: Unpin,
[src]
S: Unpin,
impl<S> UnwindSafe for Handshake<S> where
S: UnwindSafe,
[src]
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,