pub fn handshake_done(&mut self) -> Result<bool, OssuaryError> {
        match self.state {
            ConnectionState::Encrypted => Ok(true),
            ConnectionState::Failed(ref e) => Err(e.clone()),
            ConnectionState::ClientRaiseUntrustedServer => {
                self.state = ConnectionState::ClientWaitServerApproval;
                let mut key: Vec<u8> = Vec::new();
                match self.remote_auth.public_key {
                    Some(ref p) => key.extend_from_slice(p.as_bytes()),
                    None => key.extend_from_slice(&[0; KEY_LEN]),
                };
                Err(OssuaryError::UntrustedServer(key))
            },
            _ => Ok(false),
        }
    }
/// Returns whether the handshake process is complete.
///
/// Returns an error if the connection has failed, and specifically raises
/// [`OssuaryError::UntrustedServer`] if the handshake has stalled because
/// the remote host sent an authentication key that is not trusted.
///
/// In the event of an untrusted server, calling
/// [`OssuaryConnection::add_authorized_key`] will mark the key as trusted
/// and allow the handshake to continue.  This should only be done if the
/// application is implementing a Trust-On-First-Use policy, and has
/// verified that the remote host's key has never been seen before.  It is
/// always best practice to prompt the user in this case before continuing.
///
Returns whether the handshake process is complete.
Returns an error if the connection has failed, and specifically raises
[`OssuaryError::UntrustedServer`] if the handshake has stalled because
the remote host sent an authentication key that is not trusted.

In the event of an untrusted server, calling
[`OssuaryConnection::add_authorized_key`] will mark the key as trusted
and allow the handshake to continue.  This should only be done if the
application is implementing a Trust-On-First-Use policy, and has
verified that the remote host's key has never been seen before.  It is
always best practice to prompt the user in this case before continuing.
Returns whether the handshake process is complete . Returns an error if the connection has failed and specifically raises [ ` OssuaryError :: UntrustedServer ` ] if the handshake has stalled because the remote host sent an authentication key that is not trusted . In the event of an untrusted server calling [ ` OssuaryConnection :: add_authorized_key ` ] will mark the key as trusted and allow the handshake to continue . This should only be done if the application is implementing a Trust - On - First - Use policy and has verified that the remote host ' s key has never been seen before . It is always best practice to prompt the user in this case before continuing .
pub fn handshake_done(&mut self) -> Result<bool, OssuaryError> {
        match self.state {
            ConnectionState::Encrypted => Ok(true),
            ConnectionState::Failed(ref e) => Err(e.clone()),
            ConnectionState::ClientRaiseUntrustedServer => {
                self.state = ConnectionState::ClientWaitServerApproval;
                let mut key: Vec<u8> = Vec::new();
                match self.remote_auth.public_key {
                    Some(ref p) => key.extend_from_slice(p.as_bytes()),
                    None => key.extend_from_slice(&[0; KEY_LEN]),
                };
                Err(OssuaryError::UntrustedServer(key))
            },
            _ => Ok(false),
        }
    }
pub fn handshake_done ( & mut self ) -> Result < bool , OssuaryError > { match self . state { ConnectionState :: Encrypted => Ok ( true ) , ConnectionState :: Failed ( ref e ) => Err ( e . clone ( ) ) , ConnectionState :: ClientRaiseUntrustedServer => { self . state = ConnectionState :: ClientWaitServerApproval ; let mut key : Vec < u8 > = Vec :: new ( ) ; match self . remote_auth . public_key { Some ( ref p ) => key . extend_from_slice ( p . as_bytes ( ) ) , None => key . extend_from_slice ( & [ 0 ; KEY_LEN ] ) , } ; Err ( OssuaryError :: UntrustedServer ( key ) ) } , _ => Ok ( false ) , } }
Returns whether the handshake process is complete.
Returns whether the handshake process is complete .
&mut self
&mut self