Source File
security.go
Belonging Package
github.com/libp2p/go-libp2p/core/sec
// Package sec provides secure connection and transport interfaces for libp2p.package secimport ()// SecureConn is an authenticated, encrypted connection.type SecureConn interface {net.Connnetwork.ConnSecurity}// A SecureTransport turns inbound and outbound unauthenticated,// plain-text, native connections into authenticated, encrypted connections.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}type ErrPeerIDMismatch struct {Expected peer.IDActual peer.ID}func ( ErrPeerIDMismatch) () string {return fmt.Sprintf("peer id mismatch: expected %s, but remote key matches %s", .Expected, .Actual)}var _ error = (*ErrPeerIDMismatch)(nil)
![]() |
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. |