insecure

package
v0.0.0-...-8b9b725 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT, MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const ID = "/plaintext/1.0.0"

ID is the multistream-select protocol ID that should be used when identifying this security transport.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn is the connection type returned by the insecure transport.

func (*Conn) LocalPeer

func (ic *Conn) LocalPeer() peer.ID

LocalPeer returns the local peer ID.

func (*Conn) LocalPrivateKey

func (ic *Conn) LocalPrivateKey() ci.PrivKey

LocalPrivateKey returns nil. This connection is not secure.

func (*Conn) RemotePeer

func (ic *Conn) RemotePeer() peer.ID

RemotePeer returns the remote peer ID if we initiated the dial. Otherwise, it returns "" (because this connection isn't actually secure).

func (*Conn) RemotePublicKey

func (ic *Conn) RemotePublicKey() ci.PubKey

RemotePublicKey returns nil. This connection is not secure

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Transport is a no-op stream security transport. It provides no security and simply wraps connections in blank

func New

func New(id peer.ID) *Transport

New constructs a new insecure transport.

func (*Transport) LocalPeer

func (t *Transport) LocalPeer() peer.ID

LocalPeer returns the transports local peer ID.

func (*Transport) LocalPrivateKey

func (t *Transport) LocalPrivateKey() ci.PrivKey

LocalPrivateKey returns nil. This transport is not secure.

func (*Transport) SecureInbound

func (t *Transport) SecureInbound(ctx context.Context, insecure net.Conn) (security.Conn, error)

SecureInbound *pretends to secure* an outbound connection to the given peer.

func (*Transport) SecureOutbound

func (t *Transport) SecureOutbound(ctx context.Context, insecure net.Conn, p peer.ID) (security.Conn, error)

SecureOutbound *pretends to secure* an outbound connection to the given peer.

Jump to

Keyboard shortcuts

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