client

package
v0.0.0-...-ffa6f3e Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package client provides a mixnet client library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KatzenClient

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

KatzenClient is katzenpost object

func NewKatzenClient

func NewKatzenClient(pkiAddress, pkiKey string, logConfig *LogConfig) (*KatzenClient, error)

NewClient configures the pki to be used

func (*KatzenClient) NewSession

func (c *KatzenClient) NewSession(user string, provider string, linkPrivKey *Key) (*Session, error)

NewSession stablishes a session with provider using key

type Key

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

Key keeps the key public and private data

func GenKey

func GenKey() (*Key, error)

GenKey creates a new ecdh key

func KeyFromBase64

func KeyFromBase64(keyStr string) (*Key, error)

StringToKey builds a Key from a string

type LogConfig

type LogConfig struct {
	File    string
	Level   string
	Enabled bool
}

LogConfig keeps the configuration of the loger

type MessageConsumer

type MessageConsumer interface {
	ReceivedMessage(senderPubKey *ecdh.PublicKey, message []byte)
	ReceivedACK(messageID *[block.MessageIDLength]byte, message []byte)
}

MessageConsumer is an interface used for processing received messages

type Session

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

Session holds the client session

func (*Session) Connect

func (s *Session) Connect(identityPrivKey *Key, messageConsumer MessageConsumer) error

Connect connects the client to the Provider

func (*Session) Get

func (s *Session) Get(identity string) (*ecdh.PublicKey, error)

Get returns the identity public key for a given identity. This is part of the UserKeyDiscovery interface defined in the client library. XXX fix me

func (*Session) Send

func (s *Session) Send(recipient, provider string, msg string) error

Send into the mix network

func (*Session) SendUnreliable

func (s *Session) SendUnreliable(recipient, provider string, msg string) error

SendUnreliable into the mix network

func (*Session) Shutdown

func (s *Session) Shutdown()

Shutdown the session

type StorageStub

type StorageStub struct {
}

StorageStub implements the Storage interface as defined in the client library. XXX This should be replaced by something useful.

func (*StorageStub) GetBlocks

func (s *StorageStub) GetBlocks(*[block.MessageIDLength]byte) ([][]byte, error)

GetBlocks returns a slice of blocks

func (*StorageStub) PutBlock

func (s *StorageStub) PutBlock(*[block.MessageIDLength]byte, []byte) error

PutBlock puts a block into storage

Jump to

Keyboard shortcuts

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