client

package
v0.0.0-...-8b4e12d Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCode   = 1
	SuccessCode = 0
)

Variables

View Source
var ErrBadRequest = errors.New("Unexpected or invalid request")
View Source
var GenerateKeys bool
View Source
var Host string

Host ip address or host name of server

View Source
var Port int

Port port that ucp server is listening on defaults to 8978

View Source
var RemoteUser string
View Source
var ShowHelp bool
View Source
var UCPDirectory string

UCPDirectory path to keys and known_hosts file

Functions

func CreateAESEncryptedConnection

func CreateAESEncryptedConnection(rootConn net.Conn, asyncEncryptedConn unet.EncodeConn) (aesEncryptedConn unet.EncodeConn, e error)

CreateAESEncryptedConnection creates a connection that uses AES encryption. AES (Symmetric Key) encryption is much faster than RSA

func CreateRSAEncryptedConnection

func CreateRSAEncryptedConnection(privateKey *rsa.PrivateKey, conn net.Conn) (econn *unet.GobEncoderReaderWriter, e error)

CreateRSAEncryptedConnection creates a network connection that will RSA encrypt bytes before sending them. Takes an RSA private key and a network connection as arguments.

func ExitOnError

func ExitOnError(e error, msgs ...string)

func GetCurrentUserName

func GetCurrentUserName() string

func HandleUserAuthorization

func HandleUserAuthorization(conn net.EncodeConn, prompt Prompter) (e error)

TODO: this needs a test

Types

type Prompt

type Prompt struct {
}

func (*Prompt) GetPassword

func (p *Prompt) GetPassword() (pwd string, e error)

type Prompter

type Prompter interface {
	GetPassword() (string, error)
}

Jump to

Keyboard shortcuts

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