clientCore

package
v0.0.0-...-f65740e Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoClient

type CryptoClient struct {
	Provider config.MixConfig
	Network  NetworkPKI
	// contains filtered or unexported fields
}

func NewCryptoClient

func NewCryptoClient(pubKey, privKey []byte, curve elliptic.Curve, provider config.MixConfig, network NetworkPKI) *CryptoClient

func (*CryptoClient) DecodeMessage

func (c *CryptoClient) DecodeMessage(packet sphinx.SphinxPacket) (sphinx.SphinxPacket, error)

DecodeMessage decodes the received sphinx packet. TODO: this function is finished yet.

func (*CryptoClient) EncodeMessage

func (c *CryptoClient) EncodeMessage(message string, recipient config.ClientConfig) ([]byte, error)

EncodeMessage encodes given message into the Sphinx packet format. EncodeMessage takes as inputs the message and the recipient's public configuration. EncodeMessage returns the byte representation of the packet or an error if the packet could not be created.

func (*CryptoClient) GetPublicKey

func (c *CryptoClient) GetPublicKey() []byte

type MixClient

type MixClient interface {
	EncodeIntoSphinxPacket(message string, recipient config.ClientConfig) ([]byte, error)
	DecodeSphinxPacket(packet sphinx.SphinxPacket) (sphinx.SphinxPacket, error)
	GetPublicKey() []byte
}

type NetworkPKI

type NetworkPKI struct {
	Mixes   []config.MixConfig
	Clients []config.ClientConfig
}

Jump to

Keyboard shortcuts

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