client

package
v0.0.0-...-f4f6315 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

README

CONIKS Client implementation in Golang

Do not use your real public key or private key with this test client.

Usage

Install the test client
⇒  go install github.com/coniks-sys/coniks-go/client/coniksclient
⇒  coniksclient -h
________  _______  __    _  ___  ___   _  _______
|       ||       ||  |  | ||   ||   | | ||       |
|       ||   _   ||   |_| ||   ||   |_| ||  _____|
|       ||  | |  ||       ||   ||      _|| |_____
|      _||  |_|  ||  _    ||   ||     |_ |_____  |
|     |_ |       || | |   ||   ||    _  | _____| |
|_______||_______||_|  |__||___||___| |_||_______|

Usage:
  coniksclient [command]

Available Commands:
  init        Creates a config file for the client.
  run         Run the test client.

Use "coniksclient [command] --help" for more information about a command.
Configure the client
  • Generate the configuration file:
⇒  mkdir coniks-client; cd coniks-client
⇒  coniksclient init
  • Ensure the client has the server's test public signing key.
  • Edit the configuration file as needed:
    • Replace the sign_pubkey_path with the location of the server's public signing key.
    • Replace the registration_address with the server's registration address.
    • Replace the address with the server's public CONIKS address (for lookups, monitoring etc).
Run the client
⇒  coniksclient run  # this will open a REPL
Register a new name-to-public key mapping with the CONIKS server
> register [name] [key]
# The client should display something like this if the request is successful
[+] Succesfully registered name: alice
Look up a public key
> lookup [name]
# The client should display something like this if the request is successful
[+] Found! Key bound to name is: [alice_fake_public_key]
Other commands

Use help for more information.

Use exit to close the REPL and exit the client.

Disclaimer

Please keep in mind that this CONIKS client is under active development. The repository may contain experimental features that aren't fully tested. We recommend using a tagged release.

Documentation

Overview

Package client provides an executable reference implementation of a simple client for the CONIKS key management system.

This test client is designed to communicate with the basic implementation of a CONIKS server.

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.

func UnmarshalResponse

func UnmarshalResponse(t int, msg []byte) *p.Response

UnmarshalResponse decodes the given message into a protocol.Response according to the given request type t. The request types are integer constants defined in the protocol package.

Types

type Config

type Config struct {
	SignPubkeyPath string `toml:"sign_pubkey_path"`

	SigningPubKey sign.PublicKey

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

	ServerAddress *ServerAddress `toml:"server-address,omitempty"`
}

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 LoadConfig

func LoadConfig(file string) (*Config, error)

LoadConfig returns a client's configuration read from the given filename. It reads the signing public-key file and parses the actual key. If there is any parsing or IO-error it returns an error (and the returned config will be nil).

type ServerAddress

type ServerAddress struct {
	// Address is formatted as : https://address:port
	Address string `toml:"address"`
	// TLSCertPath is a path to the server's TLS Certificate,
	// which has to be set if the connection is TCP.
	TLSCertPath string `toml:"cert"`
	// TLSKeyPath is a path to the server's TLS private key,
	// which has to be set if the connection is TCP.
	TLSKeyPath string `toml:"key"`
}

A ServerAddress describes a ConiksClient server connection. The address must be specified explicitly. Additionally, HTTP connections must use TLS for added security, and each is required to specify a TLS certificate and corresponding private key.

Directories

Path Synopsis
Executable CONIKS test client.
Executable CONIKS test client.

Jump to

Keyboard shortcuts

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