tunnel

package module
v0.0.0-...-c7e80e5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2014 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Documentation

Overview

Package tunnel eases creation of simple TLS connection over insecure network between safe, fully controlled endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(serverAddr string, cert *KeyPair, otherPubKey *x509.Certificate) (*tls.Conn, error)

func Serve

func Serve(tcpPort uint, cert *KeyPair, otherPubKey *x509.Certificate, handler ClientHandler) error

Types

type ClientHandler

type ClientHandler func(*tls.Conn, error) (more bool)

type KeyPair

type KeyPair struct {
	// contains filtered or unexported fields
}

Private + public key information.

func Keygen

func Keygen(name string) (*KeyPair, error)

Generates a randomized 1024b RSA self-signed private+public key set. The key is not useful out of this package (e.g. in fully-fledged TLS), as it is set to be marked as expired by the time it is created.

func PEMDecode

func PEMDecode(pub, priv []byte) (*KeyPair, error)

Load a private+public key pair from PEM-encoded serialized form.

func (KeyPair) PEMEncoded

func (pair KeyPair) PEMEncoded() (pub, priv []byte)

Serialize the private+public key pair using PEM encoding.

func (KeyPair) Pub

func (pair KeyPair) Pub() *x509.Certificate

Get the public part of the key pair.

func (KeyPair) Save

func (pair KeyPair) Save(pubpath, privpath string) error

Jump to

Keyboard shortcuts

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