Struct snow::NoiseBuilder
[−]
[src]
pub struct NoiseBuilder<'builder> { /* fields omitted */ }
Generates a NoiseSession
and also validate that all the prerequisites for
the given parameters are satisfied.
Examples
let noise = NoiseBuilder::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();
Methods
impl<'builder> NoiseBuilder<'builder>
[src]
pub fn new(params: NoiseParams) -> Self
[src]
Create a NoiseBuilder with the default crypto resolver.
pub fn with_resolver(params: NoiseParams, resolver: Box<CryptoResolver>) -> Self
[src]
Create a NoiseBuilder with a custom crypto resolver.
pub fn psk(self, location: u8, key: &'builder [u8]) -> Self
[src]
Specify a PSK (only used with NoisePSK
base parameter)
pub fn local_private_key(self, key: &'builder [u8]) -> Self
[src]
Your static private key, can be generated by generate_private_key()
.
pub fn prologue(self, key: &'builder [u8]) -> Self
[src]
Arbitrary data to be hashed in to the handshake hash value.
pub fn remote_public_key(self, pub_key: &'builder [u8]) -> Self
[src]
The responder's static public key.
pub fn generate_private_key(&self) -> Result<Vec<u8>>
[src]
Generate a new private key. It's up to the user of this library how to store this.
pub fn build_initiator(self) -> Result<Session>
[src]
Build a NoiseSession for the side who will initiate the handshake (send the first message)
pub fn build_responder(self) -> Result<Session>
[src]
Build a NoiseSession for the side who will be responder (receive the first message)