client

package
v0.0.0-...-11acf48 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKeyLookupMsg

func CreateKeyLookupMsg(name string) ([]byte, error)

CreateKeyLookupMsg returns a JSON encoding of a protocol.KeyLookupRequest for the given name.

func CreateRegistrationMsg

func CreateRegistrationMsg(name string, key []byte) ([]byte, error)

CreateRegistrationMsg returns a JSON encoding of a protocol.RegistrationRequest for the given (name, key) pair.

Types

type Config

type Config struct {
	*application.CommonConfig

	SignPubkeyPath string `toml:"sign_pubkey_path"`
	SigningPubKey  sign.PublicKey

	InitSTRPath string `toml:"init_str_path"`
	InitSTR     *protocol.DirSTR

	RegAddress string `toml:"registration_address,omitempty"`
	Address    string `toml:"address"`
}

Config contains the client's configuration needed to send a request to a CONIKS server: the path to the server's signing public-key file and the actual public-key parsed from that file; the server's addresses for sending registration requests and other types of requests, respectively.

Note that if RegAddress is empty, the client falls back to using Address for all request types.

func NewConfig

func NewConfig(file, encoding, signPubkeyPath, initSTRPath, regAddr,
	serverAddr string) *Config

NewConfig initializes a new client configuration at the given file path, with the given config encoding, server signing public key path, registration address, and server address.

func (*Config) GetPath

func (conf *Config) GetPath() string

Path returns the client's configuration file path.

func (*Config) Load

func (conf *Config) Load(file, encoding string) error

Load initializes a client's configuration from the given file using the given encoding. It reads the signing public-key file and parses the actual key.

func (*Config) Save

func (conf *Config) Save() error

Save writes a client's configuration.

Jump to

Keyboard shortcuts

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