config

package
v0.0.0-...-f4d6c7b Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package config implements the configuration for the Katzenpost client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeys

func GenerateKeys(cfg *Config) error

GenerateKeys makes the key dir and then generates the keys and saves them into pem files

func LoadLinkKey

func LoadLinkKey(basePath string) (*ecdh.PrivateKey, error)

LoadLinkKey can load or generate the keys

Types

type Account

type Account struct {
	// User is the account user name.
	User string

	// Provider is the provider identifier used by this account.
	Provider string

	// ProviderKeyPin is the optional pinned provider signing key.
	ProviderKeyPin *eddsa.PublicKey
}

Account is a provider account configuration.

type Config

type Config struct {
	Proxy              *Proxy
	Logging            *Logging
	Debug              *Debug
	NonvotingAuthority *NonvotingAuthority
	VotingAuthority    *VotingAuthority
	Account            *Account
}

Config is the top level client configuration.

func Load

func Load(b []byte, forceGenOnly bool) (*Config, error)

Load parses and validates the provided buffer b as a config file body and returns the Config.

func LoadFile

func LoadFile(f string, forceGenOnly bool) (*Config, error)

LoadFile loads, parses, and validates the provided file and returns the Config.

func (*Config) FixupAndValidate

func (c *Config) FixupAndValidate() error

FixupAndValidate applies defaults to config entries and validates the supplied configuration. Most people should call one of the Load variants instead.

func (*Config) NewPKIClient

func (c *Config) NewPKIClient(l *log.Backend) (pki.Client, error)

NewPKIClient returns a voting or nonvoting implementation of pki.Client or error

type Debug

type Debug struct {
	// TargetProvider is the target service provider for our probes.
	TargetProvider string

	// TargetRecipient is the target recipient for our probes.
	TargetRecipient string

	// SendBurst controls the burst rate of the egress rate limiter.
	SendBurst int

	// SendRate controls the egress rate limiter and is packets per second.
	SendRate float64

	// SessionDialTimeout is the number of seconds that a session dial
	// is allowed to take until it is cancelled.
	SessionDialTimeout int

	// InitialMaxPKIRetrievalDelay is the initial maximum number of seconds
	// we are willing to wait for the retreival of the PKI document.
	InitialMaxPKIRetrievalDelay int

	// CaseSensitiveUserIdentifiers disables the forced lower casing of
	// the Account `User` field.
	CaseSensitiveUserIdentifiers bool

	// GenerateOnly halts and cleans up right after long term
	// key generation.
	GenerateOnly bool

	// PollingInterval is the interval in seconds that will be used to
	// poll the receive queue.  By default this is 30 seconds.  Reducing
	// the value too far WILL result in uneccesary Provider load, and
	// increasing the value too far WILL adversely affect large message
	// transmit performance.
	PollingInterval int
}

Debug is the debug configuration.

type Logging

type Logging struct {
	// Disable disables logging entirely.
	Disable bool

	// File specifies the log file, if omitted stdout will be used.
	File string

	// Level specifies the log level.
	Level string
}

Logging is the logging configuration.

type NonvotingAuthority

type NonvotingAuthority struct {
	// Address is the IP address/port combination of the authority.
	Address string

	// PublicKey is the authority's public key.
	PublicKey *eddsa.PublicKey
}

NonvotingAuthority is a non-voting authority configuration.

func (*NonvotingAuthority) New

func (nvACfg *NonvotingAuthority) New(l *log.Backend) (pki.Client, error)

New constructs a pki.Client with the specified non-voting authority config.

type Proxy

type Proxy struct {
	// DataDir is the absolute path to the data directory.
	DataDir string
}

Proxy is the proxy configuration.

type VotingAuthority

type VotingAuthority struct {
	Peers []*vServerConfig.AuthorityPeer
}

VotingAuthority is a voting authority configuration.

func (*VotingAuthority) New

func (vACfg *VotingAuthority) New(l *log.Backend) (pki.Client, error)

New constructs a pki.Client with the specified non-voting authority config.

Jump to

Keyboard shortcuts

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