streaming

package
v0.0.0-...-e675987 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package streaming contains writer and reader implementing Crypt4GH encryption and decryption correspondingly.

Package streaming contains writer and reader implementing Crypt4GH encryption and decryption correspondingly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypt4GHReader

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

Crypt4GHReader structure implements io.Reader and io.ByteReader.

func NewCrypt4GHReader

func NewCrypt4GHReader(reader io.Reader, readerPrivateKey [chacha20poly1305.KeySize]byte, dataEditList *headers.DataEditListHeaderPacket) (*Crypt4GHReader, error)

NewCrypt4GHReader method constructs streaming.Crypt4GHReader instance from io.Reader and corresponding key.

func (*Crypt4GHReader) Discard

func (c *Crypt4GHReader) Discard(n int) (discarded int, err error)

Discard method skips the next n bytes, returning the number of bytes discarded.

func (Crypt4GHReader) GetHeader

func (c Crypt4GHReader) GetHeader() []byte

GetHeader method returns Crypt4GH header structure.

func (*Crypt4GHReader) Read

func (c *Crypt4GHReader) Read(p []byte) (n int, err error)

Read method implements io.Reader.Read.

func (*Crypt4GHReader) ReadByte

func (c *Crypt4GHReader) ReadByte() (byte, error)

ReadByte method implements io.ByteReader.ReadByte.

type Crypt4GHWriter

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

Crypt4GHWriter structure implements io.WriteCloser and io.ByteWriter.

func NewCrypt4GHWriter

func NewCrypt4GHWriter(writer io.Writer, writerPrivateKey, readerPublicKey [chacha20poly1305.KeySize]byte, dataEditList *headers.DataEditListHeaderPacket) (*Crypt4GHWriter, error)

NewCrypt4GHWriter method constructs streaming.Crypt4GHWriter instance from io.Writer and corresponding keys.

func (*Crypt4GHWriter) Close

func (c *Crypt4GHWriter) Close() error

Close method implements io.Closer.Close.

func (*Crypt4GHWriter) Write

func (c *Crypt4GHWriter) Write(p []byte) (n int, err error)

Write method implements io.Writer.Write.

func (*Crypt4GHWriter) WriteByte

func (c *Crypt4GHWriter) WriteByte(b byte) error

WriteByte method implements io.ByteWriter.WriteByte.

Jump to

Keyboard shortcuts

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