identity

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handshaker

type Handshaker interface {
	// Execute executes the handshake with a context.
	// Returning an error cancels the attempt.
	Execute(ctx context.Context) (*Result, error)
	// Handle handles an incoming packet.
	// The buffer will be re-used after the func returns.
	// Returns if we expect more handshake packets.
	Handle(data []byte) bool
	// Close cleans up any resources allocated by the handshake.
	Close()
}

Handshaker performs an identity handshake.

type Result

type Result struct {
	// Secret is the negotiated secret.
	Secret [32]byte
	// Peer is the public key of the remote peer.
	Peer crypto.PubKey
	// ExtraData is the extra data the remote peer sent.
	ExtraData []byte
}

Result is the outcome of the handshake.

Directories

Path Synopsis
s2s
e2e

Jump to

Keyboard shortcuts

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