spipe

package
v0.0.0-...-bebc87d Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package spipe is a generated protocol buffer package.

It is generated from these files:

message.proto

It has these top-level messages:

Propose
Exchange

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("connection closed")

ErrClosed signals the closing of a connection.

View Source
var ErrUnsupportedKeyType = errors.New("unsupported key type")

ErrUnsupportedKeyType is returned when a private key cast/type switch fails.

View Source
var SupportedCiphers = "AES-256,AES-128"

List of supported Ciphers

View Source
var SupportedExchanges = "P-256,P-224,P-384,P-521"

List of supported ECDH curves

View Source
var SupportedHashes = "SHA256,SHA512,SHA1"

List of supported Hashes

Functions

func IDFromPubKey

func IDFromPubKey(pk ci.PubKey) (peer.ID, error)

IDFromPubKey retrieves a Public Key from the peer given by pk

Types

type Duplex

type Duplex struct {
	In  chan []byte
	Out chan []byte
}

Duplex is a simple duplex channel

type Exchange

type Exchange struct {
	Epubkey          []byte `protobuf:"bytes,1,opt,name=epubkey" json:"epubkey,omitempty"`
	Signature        []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*Exchange) GetEpubkey

func (m *Exchange) GetEpubkey() []byte

func (*Exchange) GetSignature

func (m *Exchange) GetSignature() []byte

func (*Exchange) ProtoMessage

func (*Exchange) ProtoMessage()

func (*Exchange) Reset

func (m *Exchange) Reset()

func (*Exchange) String

func (m *Exchange) String() string

type Propose

type Propose struct {
	Rand             []byte  `protobuf:"bytes,1,opt,name=rand" json:"rand,omitempty"`
	Pubkey           []byte  `protobuf:"bytes,2,opt,name=pubkey" json:"pubkey,omitempty"`
	Exchanges        *string `protobuf:"bytes,3,opt,name=exchanges" json:"exchanges,omitempty"`
	Ciphers          *string `protobuf:"bytes,4,opt,name=ciphers" json:"ciphers,omitempty"`
	Hashes           *string `protobuf:"bytes,5,opt,name=hashes" json:"hashes,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*Propose) GetCiphers

func (m *Propose) GetCiphers() string

func (*Propose) GetExchanges

func (m *Propose) GetExchanges() string

func (*Propose) GetHashes

func (m *Propose) GetHashes() string

func (*Propose) GetPubkey

func (m *Propose) GetPubkey() []byte

func (*Propose) GetRand

func (m *Propose) GetRand() []byte

func (*Propose) ProtoMessage

func (*Propose) ProtoMessage()

func (*Propose) Reset

func (m *Propose) Reset()

func (*Propose) String

func (m *Propose) String() string

type SecurePipe

type SecurePipe struct {
	Duplex
	// contains filtered or unexported fields
}

SecurePipe objects represent a bi-directional message channel.

func NewSecurePipe

func NewSecurePipe(ctx context.Context, bufsize int, local *peer.Peer,
	peers peer.Peerstore) (*SecurePipe, error)

NewSecurePipe constructs a pipe with channels of a given buffer size.

func (*SecurePipe) Close

func (s *SecurePipe) Close() error

Close closes the secure pipe

func (*SecurePipe) LocalPeer

func (s *SecurePipe) LocalPeer() *peer.Peer

LocalPeer retrieves the local peer.

func (*SecurePipe) RemotePeer

func (s *SecurePipe) RemotePeer() *peer.Peer

RemotePeer retrieves the local peer.

func (*SecurePipe) Wrap

func (s *SecurePipe) Wrap(ctx context.Context, insecure Duplex) error

Wrap creates a secure connection on top of an insecure duplex channel.

Jump to

Keyboard shortcuts

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