encrypt

package
v1.0.2-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

WireSet provides a wire set for this package.

Functions

This section is empty.

Types

type Aesgcm

type Aesgcm struct {
	Compat bool
	// contains filtered or unexported fields
}

Aesgcm provides an encrypter that uses the aesgcm encryption algorithm.

func (*Aesgcm) Decrypt

func (e *Aesgcm) Decrypt(ciphertext []byte) (string, error)

Decrypt decrypts the ciphertext using aesgcm.

func (*Aesgcm) Encrypt

func (e *Aesgcm) Encrypt(plaintext string) ([]byte, error)

Encrypt encrypts the plaintext using aesgcm.

type Encrypter

type Encrypter interface {
	Encrypt(plaintext string) ([]byte, error)
	Decrypt(ciphertext []byte) (string, error)
}

Encrypter provides field encryption and decryption. Encrypted values are currently limited to strings, which is reflected in the interface design.

func New

func New(key string, compat bool) (Encrypter, error)

New provides a new aesgcm encrypter.

func ProvideEncrypter

func ProvideEncrypter(config *types.Config) (Encrypter, error)

Jump to

Keyboard shortcuts

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