encryption

package
v0.2.34 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgeEncryptor

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

AgeEncryptor implements the Encryptor interface using age

func (*AgeEncryptor) Encrypt

func (e *AgeEncryptor) Encrypt(in io.Reader) (io.ReadCloser, error)

type CustomEncryptor

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

CustomEncryptor is an implementation of Encryptor that uses a custom command to encrypt data.

func (CustomEncryptor) Encrypt

func (c CustomEncryptor) Encrypt(in io.Reader) (io.ReadCloser, error)

type Encryptor

type Encryptor interface {
	// Encrypt encrypts the data from the given reader and returns an io.ReadCloser
	// that can be used to read the encrypted data. The last parameter indicates whether
	// this is the last piece of data to be encrypted. This function is expected to be called only once.
	// To resume previous encryption, use LoadState before calling Encrypt. To save the encryption state
	// for later resumption, use GetState after calling Encrypt.
	Encrypt(in io.Reader) (io.ReadCloser, error)
}

Encryptor is an interface that defines the methods required to encrypt data in a resumable way.

func GetEncryptor

func GetEncryptor(dataset model.Dataset) (Encryptor, error)

func NewAgeEncryptor

func NewAgeEncryptor(recipients []string) (Encryptor, error)

func NewCustomEncryptor

func NewCustomEncryptor(cmd *exec.Cmd) Encryptor

Jump to

Keyboard shortcuts

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