format2

package
v0.0.0-...-e4cc500 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Wire format 2, Encrypted Preamble File.

Index

Constants

This section is empty.

Variables

View Source
var (
	EUnknownCipherType   = fmt.Errorf("Unknown Cipher Type")
	EBlockAlignmentError = fmt.Errorf("Block Alignment Error")
	ENonceError          = fmt.Errorf("Nonce Error")
)

Functions

func NewReader

func NewReader(r io.Reader, decr Decrypter) (io.Reader, error)

NOTE: Returns a *Reader object.

func NewWriter

func NewWriter(w io.Writer, enc Encrypter) (io.WriteCloser, error)

NOTE: Returns a *Writer object.

Types

type CipherObject

type CipherObject struct {
	Block  cipher.BlockMode
	Stream cipher.Stream
	AEAD   cipher.AEAD
	// contains filtered or unexported fields
}

A generic cipher that can be a one of...

cipher.BlockMode
cipher.Stream
cipher.AEAD

type Data

type Data struct {
	Last  bool
	Nonce []byte
	Data  []byte
	// contains filtered or unexported fields
}

type Decrypter

type Decrypter interface {
	StartDecryption(p *Preamble) (*CipherObject, error)
}

type Encrypter

type Encrypter interface {
	StartEncryption() (*Preamble, *CipherObject, error)
}

type Preamble

type Preamble struct {
	Opaque   []byte
	PK_Algo  string
	Encoding string
	// contains filtered or unexported fields
}

type Reader

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

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

type Writer

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

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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