Struct secret_stream::ServerFilter [] [src]

pub struct ServerFilter<'a, S, FilterFn, AsyncBool>(_);

A future that accepts a secret-handshake based on a filter function and then yields a channel that encrypts/decrypts all data via box-stream.

Methods

impl<'a, S, FilterFn, AsyncBool> ServerFilter<'a, S, FilterFn, AsyncBool> where
    S: AsyncRead + AsyncWrite,
    FilterFn: FnOnce(&PublicKey) -> AsyncBool,
    AsyncBool: Future<Item = bool>, 
[src]

[src]

Create a new ServerFilter to accept a connection from a client which knows the server's public key, uses the right app key over the given stream and whose longterm public key is accepted by the filter function.

Ephemeral keypairs can be generated via sodiumoxide::crypto::box_::gen_keypair.

Trait Implementations

impl<'a, S, FilterFn, AsyncBool> Future for ServerFilter<'a, S, FilterFn, AsyncBool> where
    S: AsyncRead + AsyncWrite,
    FilterFn: FnOnce(&PublicKey) -> AsyncBool,
    AsyncBool: Future<Item = bool>, 
[src]

On success, the result contains the encrypted connection and the longterm public key of the client.

An error

[src]

Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

Auto Trait Implementations

impl<'a, S, FilterFn, AsyncBool> !Send for ServerFilter<'a, S, FilterFn, AsyncBool>

impl<'a, S, FilterFn, AsyncBool> !Sync for ServerFilter<'a, S, FilterFn, AsyncBool>