secretstream

package module
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 11 Imported by: 10

README

secretstream Build Status GoDoc Go Report Card REUSE status

A port of secret-handshake to Go.

Provides an encrypted bidirectional stream using two boxstreams. Uses secret-handshake to negotiate the keys and nonces.

Development

If you want to run the compatability tests against the nodejs implementation, run npm ci && go test -tags interop_nodejs on the secrethandshake and boxstream sub-packages.

Documentation

Index

Constants

View Source
const NetworkString = "shs-bs"

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	PubKey []byte
}

Addr wrapps a net.Addr and adds the public key

func (Addr) Network

func (a Addr) Network() string

Network returns NetworkString, the network id of this protocol. Can be used with go.cryptoscope.co/netwrap to wrap the underlying connection.

func (Addr) String

func (a Addr) String() string

type Client

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

Client can dial secret-handshake server endpoints

func NewClient

func NewClient(kp secrethandshake.EdKeyPair, appKey []byte) (*Client, error)

NewClient creates a new Client with the passed keyPair and appKey

func (*Client) ConnWrapper

func (c *Client) ConnWrapper(pubKey []byte) netwrap.ConnWrapper

ConnWrapper returns a connection wrapper for the client.

type Conn

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

Conn is a boxstream wrapped net.Conn

func (*Conn) Close

func (conn *Conn) Close() error

Close closes the underlying net.Conn

func (*Conn) LocalAddr

func (conn *Conn) LocalAddr() net.Addr

LocalAddr returns the local net.Addr with the local public key

func (*Conn) Read added in v1.2.1

func (conn *Conn) Read(p []byte) (int, error)

Read implements io.Reader.

func (*Conn) RemoteAddr

func (conn *Conn) RemoteAddr() net.Addr

RemoteAddr returns the remote net.Addr with the remote public key

func (*Conn) SetDeadline

func (conn *Conn) SetDeadline(t time.Time) error

SetDeadline passes the call to the underlying net.Conn

func (*Conn) SetReadDeadline

func (conn *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline passes the call to the underlying net.Conn

func (*Conn) SetWriteDeadline

func (conn *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline passes the call to the underlying net.Conn

func (*Conn) Write added in v1.2.1

func (conn *Conn) Write(p []byte) (int, error)

Write implements io.Writer.

type Server

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

Server can create net.Listeners

func NewServer

func NewServer(keyPair secrethandshake.EdKeyPair, appKey []byte) (*Server, error)

NewServer returns a Server which uses the passed keyPair and appKey

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the shs-bs address of the server.

func (*Server) ConnWrapper

func (s *Server) ConnWrapper() netwrap.ConnWrapper

ConnWrapper returns a connection wrapper.

func (*Server) ListenerWrapper

func (s *Server) ListenerWrapper() netwrap.ListenerWrapper

ListenerWrapper returns a listener wrapper.

Directories

Path Synopsis
Package boxstream implements npm:pull-box-stream in Go (without the pull) https://github.com/dominictarr/pull-box-stream
Package boxstream implements npm:pull-box-stream in Go (without the pull) https://github.com/dominictarr/pull-box-stream
internal
Package secrethandshake is a Go implementation of Dominic Tarr's secret-handshake: https://github.com/auditdrivencrypto/secret-handshake Two instances of go-shs can secretly shake hands over a connection.
Package secrethandshake is a Go implementation of Dominic Tarr's secret-handshake: https://github.com/auditdrivencrypto/secret-handshake Two instances of go-shs can secretly shake hands over a connection.
internal/extra25519
Package extra25519 implements the key conversion from ed25519 to curve25519.
Package extra25519 implements the key conversion from ed25519 to curve25519.

Jump to

Keyboard shortcuts

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