cryptconn

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: BSD-3-Clause, GPL-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLoadPEM = errors.New("certpool: append cert to pem failed")
)

Functions

func ExchangeIV

func ExchangeIV(conn net.Conn, n int) (iv []byte, err error)

func NewBlock

func NewBlock(method string, key string) (c cipher.Block, err error)

func NewTlsDialer

func NewTlsDialer(CertFile, CertKeyFile, RootCAs, ServerName string) (dialer common.Dialer, err error)

func NewTlsListener

func NewTlsListener(raw net.Listener, CertFile, CertKeyFile, RootCAs string) (wrapped net.Listener, err error)

func RecvIV

func RecvIV(conn net.Conn, n int) (iv []byte, err error)

func SentIV

func SentIV(conn net.Conn, n int) (iv []byte, err error)

func XOR

func XOR(n int, a []byte, b []byte) (r []byte)

Types

type CryptConn

type CryptConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn net.Conn, block cipher.Block) (sc *CryptConn, err error)

func NewServer

func NewServer(conn net.Conn, block cipher.Block) (sc *CryptConn, err error)

func (*CryptConn) Read

func (sc *CryptConn) Read(b []byte) (n int, err error)

func (*CryptConn) Write

func (sc *CryptConn) Write(b []byte) (n int, err error)

type Dialer

type Dialer struct {
	common.Dialer
	// contains filtered or unexported fields
}

func NewDialer

func NewDialer(dialer common.Dialer, method string, key string) (d *Dialer, err error)

func (*Dialer) Dial

func (d *Dialer) Dial(network, addr string) (conn net.Conn, err error)

func (*Dialer) DialTimeout

func (d *Dialer) DialTimeout(network, addr string, timeout time.Duration) (conn net.Conn, err error)

type Listener

type Listener struct {
	net.Listener
	// contains filtered or unexported fields
}

func NewListener

func NewListener(listener net.Listener, method string, key string) (l *Listener, err error)

func (*Listener) Accept

func (l *Listener) Accept() (conn net.Conn, err error)

type TlsDialer

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

func (*TlsDialer) Dial

func (td *TlsDialer) Dial(network, address string) (net.Conn, error)

func (*TlsDialer) DialTimeout

func (td *TlsDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)

Jump to

Keyboard shortcuts

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