encryption

package
v0.2.39 Latest Latest
Warning

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

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

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