Struct secret_stream::OwningServer
[−]
[src]
pub struct OwningServer<S>(_);
A future that accepts a secret-handshake and then yields a channel that encrypts/decrypts all data via box-stream.
This copies the handshake keys so that it is not constrained by the key's lifetime.
Methods
impl<S: AsyncRead + AsyncWrite> OwningServer<S>
[src]
pub fn new(
stream: S,
network_identifier: [u8; 32],
server_longterm_pk: PublicKey,
server_longterm_sk: SecretKey,
server_ephemeral_pk: PublicKey,
server_ephemeral_sk: SecretKey
) -> OwningServer<S>
[src]
stream: S,
network_identifier: [u8; 32],
server_longterm_pk: PublicKey,
server_longterm_sk: SecretKey,
server_ephemeral_pk: PublicKey,
server_ephemeral_sk: SecretKey
) -> OwningServer<S>
Create a new OwningServer
to accept a connection from a client which knows
the server's public key and uses the right app key over the given
stream
.
This copies the handshake keys so that it is not constrained by the key's lifetime.
Ephemeral keypairs can be generated via
sodiumoxide::crypto::box_::gen_keypair
.
Trait Implementations
impl<S: AsyncRead + AsyncWrite> Future for OwningServer<S>
[src]
type Item = (BoxDuplex<S>, PublicKey)
On success, the result contains the encrypted connection and the longterm public key of the client.
type Error = (HandshakeError, S)
An error
fn poll(&mut self, cx: &mut Context) -> Poll<Self::Item, Self::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