catshadow: Index | Files | Directories

package catshadow

import ""


Package Files

client.go contact.go disk.go

func LoadStateWriter Uses

func LoadStateWriter(log *logging.Logger, stateFile string, passphrase []byte) (*StateWriter, *State, error)

LoadStateWriter decrypts the given stateFile and returns the State as well as a new StateWriter.

func NewContactExchangeBytes Uses

func NewContactExchangeBytes(spoolWriter *channels.UnreliableSpoolWriterChannel, signedKeyExchange *ratchet.SignedKeyExchange) ([]byte, error)

NewContactExchangeBytes returns serialized contact exchange information.

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client is the mixnet client which interacts with other clients and services on the network.

func New Uses

func New(logBackend *log.Backend, mixnetClient *client.Client, stateWorker *StateWriter, state *State) (*Client, error)

New creates a new Client instance given a mixnetClient, stateWorker and state. This constructor is used to load the previously saved state of a Client.

func NewClientAndRemoteSpool Uses

func NewClientAndRemoteSpool(logBackend *log.Backend, mixnetClient *client.Client, stateWorker *StateWriter, user string, linkKey *ecdh.PrivateKey) (*Client, error)

NewClientAndRemoteSpool creates a new Client and creates a new remote spool for collecting messages destined to this Client. The Client is associated with this remote spool and this state is preserved in the encrypted statefile, of course. This constructor of Client is used when creating a new Client as opposed to loading the previously saved state for an existing Client.

func (*Client) CreateRemoteSpool Uses

func (c *Client) CreateRemoteSpool() error

CreateRemoteSpool creates a remote spool for collecting messages destined to this Client.

func (*Client) GetAllConversations Uses

func (c *Client) GetAllConversations() map[string][]*Message

func (*Client) GetConversation Uses

func (c *Client) GetConversation(nickname string) []*Message

func (*Client) GetNicknames Uses

func (c *Client) GetNicknames() []string

func (*Client) NewContact Uses

func (c *Client) NewContact(nickname string, sharedSecret []byte)

NewContact adds a new contact to the Client's state. This starts the PANDA protocol instance for this contact where intermediate states will be preserved in the encrypted statefile such that progress on the PANDA key exchange can be continued at a later time after program shutdown or restart.

func (*Client) RemoveContact Uses

func (c *Client) RemoveContact(nickname string)

RemoveContact removes a contact from the Client's state.

func (*Client) SendMessage Uses

func (c *Client) SendMessage(nickname string, message []byte)

SendMessage sends a message to the Client contact with the given nickname.

func (*Client) Shutdown Uses

func (c *Client) Shutdown()

Shutdown shuts down the client.

func (*Client) Start Uses

func (c *Client) Start()

Start starts the client worker goroutine and the read-inbox worker goroutine.

type Contact Uses

type Contact struct {
    // contains filtered or unexported fields

Contact is a communications contact that we have bidirectional communication with.

func NewContact Uses

func NewContact(nickname string, id uint64, spoolReaderChan *channels.UnreliableSpoolReaderChannel, session *session.Session) (*Contact, error)

NewContact creates a new Contact or returns an error.

func (*Contact) ID Uses

func (c *Contact) ID() uint64

ID returns the Contact ID.

func (*Contact) MarshalBinary Uses

func (c *Contact) MarshalBinary() ([]byte, error)

MarshalBinary does what you expect and returns a serialized Contact.

func (*Contact) UnmarshalBinary Uses

func (c *Contact) UnmarshalBinary(data []byte) error

UnmarshalBinary does what you expect and initializes the given Contact with deserialized Contact fields from the given binary blob.

type Message Uses

type Message struct {
    Plaintext []byte
    Timestamp time.Time
    Outbound  bool

Message encapsulates message that is sent or received.

type State Uses

type State struct {
    SpoolReaderChan *channels.UnreliableSpoolReaderChannel
    Contacts        []*Contact
    User            string
    Provider        string
    LinkKey         *ecdh.PrivateKey
    Conversations   map[string][]*Message

State is the struct type representing the Client's state which is encrypted and persisted to disk.

type StateWriter Uses

type StateWriter struct {
    // contains filtered or unexported fields

StateWriter takes ownership of the Client's encrypted statefile and has a worker goroutine which writes updates to disk.

func NewStateWriter Uses

func NewStateWriter(log *logging.Logger, stateFile string, passphrase []byte) (*StateWriter, error)

NewStateWriter is a constructor for StateWriter which is to be used when creating the statefile for the first time.

func (*StateWriter) Start Uses

func (w *StateWriter) Start()

Start starts the StateWriter's worker goroutine.


configPackage config implements the configuration for catshadow.

Package catshadow imports 25 packages (graph). Updated 2019-09-15. Refresh now. Tools for package owners.