proto

package
v0.0.0-...-a77e882 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Connection Codec and some Cryptography primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenKeyPair

func GenKeyPair(rand io.Reader) (pub, pri []byte, err error)

func Handshake

func Handshake(other, pri []byte) (res []byte)

Types

type Allocator

type Allocator interface {
	Alloc(int) []byte
	Free([]byte)
}

type Conn

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

func NewConn

func NewConn(cw io.ReadWriteCloser, a Allocator) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Free

func (c *Conn) Free(buf []byte)

func (*Conn) ReadDocument

func (c *Conn) ReadDocument() (doc bson.Document, err error)

func (*Conn) WriteDocument

func (c *Conn) WriteDocument(doc bson.Document) error

type KeyPair

type KeyPair struct {
	Pub, Pri []byte
	Domain   string
}

func (*KeyPair) Step1

func (kp *KeyPair) Step1() bson.Document

func (*KeyPair) Step2

func (kp *KeyPair) Step2(resp bson.Document) bson.Document

type ServerAuth

type ServerAuth struct {
	Rand   io.Reader
	Pub    []byte
	Domain string
	// contains filtered or unexported fields
}

func (*ServerAuth) OnePassPrep

func (sa *ServerAuth) OnePassPrep(pub []byte, domain string) bson.Document

func (*ServerAuth) Step1

func (sa *ServerAuth) Step1(doc bson.Document) bson.Document

func (*ServerAuth) Step2

func (sa *ServerAuth) Step2(doc bson.Document) (ok bool)

Jump to

Keyboard shortcuts

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