payload

package
v0.0.0-...-8654c45 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToTwoWriters

func CopyToTwoWriters(dst1 io.Writer, dst2 io.Writer, src io.Reader) (copyOutput1 *CopyOutput, copyOutput2 *CopyOutput)

Types

type Block

type Block string
const AES256 Block = "aes256"

func GetBlockByBlockName

func GetBlockByBlockName(blockName string) (Block, error)

func (Block) CreateBlock

func (this Block) CreateBlock(rd io.Reader) (cipher.Block, []byte, error)

type BlockMode

type BlockMode string
const OFB BlockMode = "ofb"

func GetBlockModeByName

func GetBlockModeByName(blockModeName string) (BlockMode, error)

func (BlockMode) GetCipherStream

func (this BlockMode) GetCipherStream(block cipher.Block, rd io.Reader) (stream cipher.Stream, iv []byte, err error)

func (BlockMode) GetEncryptorStream

func (this BlockMode) GetEncryptorStream() (BlockStream, error)

type BlockModeStream

type BlockModeStream func(block cipher.Block, iv []byte) cipher.Stream

type BlockStream

type BlockStream func(block cipher.Block, iv []byte) cipher.Stream

type CopyOutput

type CopyOutput struct {
	Err     error
	Written int64
}

type Hash

type Hash string
const SHA512 Hash = "sha512"

func GetHashByHashName

func GetHashByHashName(hashName string) (Hash, error)

func (Hash) HashOnTheWay

func (this Hash) HashOnTheWay(data io.Reader, resultingHash chan []byte) (io.Reader, error)

func (Hash) New

func (this Hash) New() (hash.Hash, error)

type Metadata

type Metadata struct {
	IV  []byte
	Key []byte
}

func (*Metadata) MarshalJSON

func (this *Metadata) MarshalJSON() ([]byte, error)

func (*Metadata) UnmarshalJSON

func (this *Metadata) UnmarshalJSON(data []byte) (err error)

type Payload

type Payload struct {
	DataSource io.Reader
	Random     io.Reader
	HashMethod Hash
	Block      Block
	BlockMode  BlockMode

	IV   []byte
	Key  []byte
	Hash []byte
}

func GetDefaultPayload

func GetDefaultPayload(dataSource io.Reader) *Payload

func GetPayload

func GetPayload(dataSource io.Reader, acceptedContract *contract.AcceptedContract) (*Payload, error)

func (*Payload) GetAlgorithm

func (this *Payload) GetAlgorithm() string

func (*Payload) GetHash

func (this *Payload) GetHash() []byte

func (*Payload) GetHashMethod

func (this *Payload) GetHashMethod() string

func (*Payload) GetKey

func (this *Payload) GetKey() []byte

func (*Payload) GetMode

func (this *Payload) GetMode() string

func (*Payload) GetPayloadData

func (this *Payload) GetPayloadData() (io.Reader, error)

Jump to

Keyboard shortcuts

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