pub struct NoiseConfig<P, C: Zeroize, R = ()> { /* private fields */ }
Expand description

The protocol upgrade configuration.

Implementations§

Turn the NoiseConfig into an authenticated upgrade for use with a Swarm.

Set the noise prologue.

Sets the legacy configuration options to use, if any.

Create a new NoiseConfig for the IX handshake pattern.

Create a new NoiseConfig for the XX handshake pattern.

Create a new NoiseConfig for the IK handshake pattern (recipient side).

Since the identity of the local node is known to the remote, this configuration does not transmit a static DH public key or public identity key to the remote.

Create a new NoiseConfig for the IK handshake pattern (initiator side).

In this configuration, the remote identity is known to the local node, but the local node still needs to transmit its own public identity.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Implements the responder part of the IK handshake pattern.

IK is a single round-trip (2 messages) handshake.

In the IK handshake, the initiator is expected to know the responder’s identity already, which is why the responder does not send it in the second message.

initiator -{id}-> responder
initiator <-{id}- responder
Output after the upgrade has been successfully negotiated and the handshake performed.
Possible error during the handshake.
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more

Implements the responder part of the IX noise handshake pattern.

IX is a single round-trip (2 messages) handshake in which each party sends their identity over to the other party.

initiator -{id}-> responder
initiator <-{id}- responder
Output after the upgrade has been successfully negotiated and the handshake performed.
Possible error during the handshake.
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more

Implements the responder part of the XX noise handshake pattern.

XX is a 1.5 round-trip (3 messages) handshake. The first message in a noise handshake is unencrypted. In the XX handshake pattern, that message is empty and thus does not leak any information. The identities are then exchanged in the second and third message.

initiator --{}--> responder
initiator <-{id}- responder
initiator -{id}-> responder
Output after the upgrade has been successfully negotiated and the handshake performed.
Possible error during the handshake.
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more

Implements the initiator part of the IK handshake pattern.

IK is a single round-trip (2 messages) handshake.

In the IK handshake, the initiator knows and pre-configures the remote’s identity in the HandshakeState.

initiator -{id}-> responder
initiator <-{id}- responder
Output after the upgrade has been successfully negotiated and the handshake performed.
Possible error during the handshake.
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more

Implements the initiator part of the IX noise handshake pattern.

IX is a single round-trip (2 messages) handshake in which each party sends their identity over to the other party.

initiator -{id}-> responder
initiator <-{id}- responder
Output after the upgrade has been successfully negotiated and the handshake performed.
Possible error during the handshake.
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more

Implements the initiator part of the XX noise handshake pattern.

XX is a 1.5 round-trip (3 messages) handshake. The first message in a noise handshake is unencrypted. In the XX handshake pattern, that message is empty and thus does not leak any information. The identities are then exchanged in the second and third message.

initiator --{}--> responder
initiator <-{id}- responder
initiator -{id}-> responder
Output after the upgrade has been successfully negotiated and the handshake performed.
Possible error during the handshake.
Future that performs the handshake with the remote.
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake. Read more
Opaque type representing a negotiable protocol.
Iterator returned by protocol_info.
Returns the list of protocols that are supported. Used during the negotiation process.

Note: This is not currently a standardised upgrade.

Opaque type representing a negotiable protocol.
Iterator returned by protocol_info.
Returns the list of protocols that are supported. Used during the negotiation process.
Opaque type representing a negotiable protocol.
Iterator returned by protocol_info.
Returns the list of protocols that are supported. Used during the negotiation process.

Note: This is not currentlyy a standardised upgrade.

Opaque type representing a negotiable protocol.
Iterator returned by protocol_info.
Returns the list of protocols that are supported. Used during the negotiation process.
Opaque type representing a negotiable protocol.
Iterator returned by protocol_info.
Returns the list of protocols that are supported. Used during the negotiation process.
Opaque type representing a negotiable protocol.
Iterator returned by protocol_info.
Returns the list of protocols that are supported. Used during the negotiation process.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Returns a new object that wraps around Self and applies a closure to the Output.
Returns a new object that wraps around Self and applies a closure to the Error.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Returns a new object that wraps around Self and applies a closure to the Output.
Returns a new object that wraps around Self and applies a closure to the Error.
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.