[−][src]Crate libp2p_noise
Noise protocol framework support for libp2p.
Note: This crate is still experimental and subject to major breaking changes both on the API and the wire protocol.
This crate provides libp2p_core::InboundUpgrade and libp2p_core::OutboundUpgrade
implementations for various noise handshake patterns (currently IK, IX, and XX)
over a particular choice of DH key agreement (currently only X25519).
All upgrades produce as output a pair, consisting of the remote's static public key
and a NoiseOutput which represents the established cryptographic session with the
remote, implementing tokio_io::AsyncRead and tokio_io::AsyncWrite.
Usage
Example:
use libp2p_core::{identity, Transport}; use libp2p_tcp::TcpConfig; use libp2p_noise::{Keypair, X25519, NoiseConfig}; let id_keys = identity::Keypair::generate_ed25519(); let dh_keys = Keypair::<X25519>::new().into_authentic(&id_keys).unwrap(); let noise = NoiseConfig::xx(dh_keys); let transport = TcpConfig::new().with_upgrade(noise); // ...
Structs
| AuthenticKeypair | A DH keypair that is authentic w.r.t. a |
| Handshake | A future performing a Noise handshake pattern. |
| Keypair | DH keypair. |
| KeypairIdentity | The associated public identity of a DH keypair. |
| NoiseConfig | The protocol upgrade configuration. |
| NoiseOutput | A noise session to a remote. |
| ProtocolParams | The parameters of a Noise protocol, consisting of a choice for a handshake pattern as well as DH, cipher and hash functions. |
| PublicKey | DH public key. |
| SecretKey | DH secret key. |
| X25519 | A X25519 key. |
Enums
| IK | Type tag for the IK handshake pattern. |
| IX | Type tag for the IX handshake pattern. |
| IdentityExchange | The options for identity exchange in an authenticated handshake. |
| NoiseError | libp2p_noise error type. |
| RemoteIdentity | The identity of the remote established during a handshake. |
| XX | Type tag for the XX handshake pattern. |
Traits
| Protocol | A Noise protocol over DH keys of type |