Struct secret_stream::OwningClient
[−]
[src]
pub struct OwningClient<S>(_);
A future that initiates 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> OwningClient<S>
[src]
pub fn new(
stream: S,
network_identifier: [u8; 32],
client_longterm_pk: PublicKey,
client_longterm_sk: SecretKey,
client_ephemeral_pk: PublicKey,
client_ephemeral_sk: SecretKey,
server_longterm_pk: PublicKey
) -> OwningClient<S>
[src]
stream: S,
network_identifier: [u8; 32],
client_longterm_pk: PublicKey,
client_longterm_sk: SecretKey,
client_ephemeral_pk: PublicKey,
client_ephemeral_sk: SecretKey,
server_longterm_pk: PublicKey
) -> OwningClient<S>
Create a new OwningClient
to connect to a server with known public key
and 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
.