sec

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 4 Imported by: 39

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 SecureConn

type SecureConn interface {
	net.Conn
	network.ConnSecurity
}

SecureConn is an authenticated, encrypted connection.

type SecureMuxer added in v0.7.1

type SecureMuxer interface {
	// SecureInbound secures an inbound connection.
	// The returned boolean indicates whether the connection should be treated as a server
	// connection; in the case of SecureInbound it should always be true.
	// If p is empty, connections from any peer are accepted.
	SecureInbound(ctx context.Context, insecure net.Conn, p peer.ID) (SecureConn, bool, error)

	// SecureOutbound secures an outbound connection.
	// The returned boolean indicates whether the connection should be treated as a server
	// connection due to simultaneous open.
	SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (SecureConn, bool, error)
}

A SecureMuxer is a wrapper around SecureTransport which can select security protocols and open outbound connections with simultaneous open.

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)
}

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

Directories

Path Synopsis
Package insecure provides an insecure, unencrypted implementation of the the SecureConn and SecureTransport interfaces.
Package insecure provides an insecure, unencrypted implementation of the the SecureConn and SecureTransport interfaces.
pb

Jump to

Keyboard shortcuts

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