package noise
Import Path
github.com/libp2p/go-libp2p/p2p/security/noise (on go.dev)
Dependency Relation
imports 25 packages, and imported by 3 packages
Package-Level Type Names (total 4)
EarlyDataHandler defines what the application payload is for either the second
(if responder) or third (if initiator) handshake message, and defines the
logic for handling the other side's early data. Note the early data in the
second handshake message is encrypted, but the peer is not authenticated at that point.
Received for the initiator is called when the second handshake message
from the responder is received.
Received for the responder is called when the third handshake message
from the initiator is received.
Send for the initiator is called for the client before sending the third
handshake message. Defines the application payload for the third message.
Send for the responder is called before sending the second handshake message.
func EarlyData(initiator, responder EarlyDataHandler) SessionOption
type SessionOption = (func)
SessionTransport can be used
to provide per-connection options
(*SessionTransport) ID() protocol.ID
SecureInbound runs the Noise handshake as the responder.
If p is empty, connections from any peer are accepted.
SecureOutbound runs the Noise handshake as the initiator.
*SessionTransport : github.com/libp2p/go-libp2p/core/sec.SecureTransport
func (*Transport).WithSessionOptions(opts ...SessionOption) (*SessionTransport, error)
(*Transport) ID() protocol.ID
SecureInbound runs the Noise handshake as the responder.
If p is empty, connections from any peer are accepted.
SecureOutbound runs the Noise handshake as the initiator.
(*Transport) WithSessionOptions(opts ...SessionOption) (*SessionTransport, error)
*Transport : github.com/libp2p/go-libp2p/core/sec.SecureTransport
func New(id protocol.ID, privkey crypto.PrivKey, muxers []tptu.StreamMuxer) (*Transport, error)
Package-Level Functions (total 5)
DisablePeerIDCheck disables checking the remote peer ID for a noise connection.
For outbound connections, this is the equivalent of calling `SecureInbound` with an empty
peer ID. This is susceptible to MITM attacks since we do not verify the identity of the remote
peer.
EarlyData sets the `EarlyDataHandler` for the initiator and responder roles.
See `EarlyDataHandler` for more details.
New creates a new Noise transport using the given private key as its
libp2p identity key.
Prologue sets a prologue for the Noise session.
The handshake will only complete successfully if both parties set the same prologue.
See https://noiseprotocol.org/noise.html#prologue for details.
func SessionWithConnState(s *secureSession, muxer protocol.ID) *secureSession
Package-Level Constants (total 4)
ID is the protocol ID for noise
LengthPrefixLength is the length of the length prefix itself, which precedes
all transport messages in order to delimit them. In bytes.
MaxPlaintextLength is the maximum payload size. It is MaxTransportMsgLength
minus the MAC size. Payloads over this size will be automatically chunked.
MaxTransportMsgLength is the Noise-imposed maximum transport message length,
inclusive of the MAC size (16 bytes, Poly1305 for noise-libp2p).
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |