Trait ServerHandshake

Source
pub(crate) trait ServerHandshake {
    type KeyType;
    type KeyGen;
    type ClientAuxData: ?Sized;
    type ServerAuxData;

    // Required method
    fn server<R: RngCore + CryptoRng, REPLY: AuxDataReply<Self>, T: AsRef<[u8]>>(
        rng: &mut R,
        reply_fn: &mut REPLY,
        key: &[Self::KeyType],
        msg: T,
    ) -> Result<(Self::KeyGen, Vec<u8>), RelayHandshakeError>;
}
Expand description

A ServerHandshake is used to handle a client onionskin and generate a server onionskin.

Required Associated Types§

Source

type KeyType

The type for the onion key. This is a private key type.

Source

type KeyGen

The returned key generator type.

Source

type ClientAuxData: ?Sized

Type of extra data sent from client (without forward secrecy).

Source

type ServerAuxData

Type of extra data returned by server (without forward secrecy).

Required Methods§

Source

fn server<R: RngCore + CryptoRng, REPLY: AuxDataReply<Self>, T: AsRef<[u8]>>( rng: &mut R, reply_fn: &mut REPLY, key: &[Self::KeyType], msg: T, ) -> Result<(Self::KeyGen, Vec<u8>), RelayHandshakeError>

Perform the server handshake. Take as input a strong PRNG in rng, a function for processing requested extensions, a slice of all our private onion keys, and the client’s message.

On success, return a key generator and a server handshake message to send in reply.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§