sec

package
v0.43.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 6 Imported by: 36 modules, 80 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sec provides secure connection and transport interfaces for libp2p.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrPeerIDMismatch

type ErrPeerIDMismatch struct {
	Expected peer.ID
	Actual   peer.ID
}

func (ErrPeerIDMismatch) Error

func (e ErrPeerIDMismatch) Error() string

type SecureConn

type SecureConn interface {
	net.Conn
	network.ConnSecurity
}

SecureConn is an authenticated, encrypted connection.

type SecureTransport

type SecureTransport interface {
	// SecureInbound secures an inbound connection.
	// If p is empty, connections from any peer are accepted.
	SecureInbound(ctx context.Context, insecure net.Conn, p peer.ID) (SecureConn, error)

	// SecureOutbound secures an outbound connection.
	SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (SecureConn, error)

	// ID is the protocol ID of the security protocol.
	ID() protocol.ID
}

A SecureTransport turns inbound and outbound unauthenticated, plain-text, native connections into authenticated, encrypted connections.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL