wormhole

package
v0.0.0-...-17e3a4f Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package wormhole implements a magick-wormhole client. Using a magick-wormhole two clients can send encrypted messages over a rendezvous server. The encryption key is agreed upon using a shared password with SPAKE2, which is a PAKE.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServer       = errors.New("server error")
	ErrKeyAgreement = errors.New("key agreement failed")
	ErrDecryption   = errors.New("decryption of message failed")
)

Functions

func DeriveSubKey

func DeriveSubKey(key, derivedKey []byte, purpose string) error

Types

type Client

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

func New

func New(appId string, url url.URL) (*Client, error)

func (*Client) AppId

func (w *Client) AppId() string

func (*Client) Close

func (w *Client) Close() error

func (*Client) CreatePassword

func (w *Client) CreatePassword(suffix string) (string, error)

func (*Client) DeriveKey

func (w *Client) DeriveKey(derivedKey []byte, purpose string) error

func (*Client) NextMessage

func (w *Client) NextMessage() ([]byte, error)

func (*Client) SendMessage

func (w *Client) SendMessage(m []byte) error

func (*Client) SendMessageJson

func (w *Client) SendMessageJson(m interface{}) error

func (*Client) SetPassword

func (w *Client) SetPassword(p string) error

func (*Client) Version

func (w *Client) Version() (string, error)

func (*Client) Welcome

func (w *Client) Welcome() (WelcomeMessage, error)

type ServerErr

type ServerErr struct {
	Msg string
}

func (ServerErr) Error

func (s ServerErr) Error() string

func (ServerErr) Unwrap

func (s ServerErr) Unwrap() error

type WelcomeMessage

type WelcomeMessage struct {
	Motd              string `json:"motd"`
	CurrentCliVersion string `json:"current_cli_version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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