pub struct Builder<'builder> { /* private fields */ }
Expand description
Generates a HandshakeState
and also validates that all the prerequisites for
the given parameters are satisfied.
Examples
let noise = Builder::new("Noise_XX_25519_ChaChaPoly_BLAKE2s".parse().unwrap())
.local_private_key(&my_long_term_key)
.remote_public_key(&their_pub_key)
.prologue("noise is just swell".as_bytes())
.build_initiator()
.unwrap();
Implementations
Create a Builder with the default crypto resolver.
pub fn with_resolver(
params: NoiseParams,
resolver: Box<dyn CryptoResolver + Send + 'static, Global>
) -> Builder<'builder>
pub fn with_resolver(
params: NoiseParams,
resolver: Box<dyn CryptoResolver + Send + 'static, Global>
) -> Builder<'builder>
Create a Builder with a custom crypto resolver.
Specify a PSK (only used with NoisePSK
base parameter)
Your static private key (can be generated with generate_keypair()
).
Arbitrary data to be hashed in to the handshake hash value.
The responder’s static public key.
Generate a new asymmetric keypair (for use as a static key).
Build a HandshakeState
for the side who will initiate the handshake (send the first message)
Build a HandshakeState
for the side who will be responder (receive the first message)