encryption

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESKeyLength

type AESKeyLength int
const (
	// DataKeyLength provides the length for data key in bytes.
	// It is recommended to use an authentication key with 32 or 64 bytes.
	// The data key length must be either
	// 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256 modes.
	AES256KeyLength AESKeyLength = 32
	AES192KeyLength AESKeyLength = 24
	AES128KeyLength AESKeyLength = 16
)

type Codec

type Codec interface {
	Seal([]byte) ([]byte, error)

	Read([]byte) ([]byte, error)
}

Codec provides the necessary method to safely retrieve secret encryption key to encrypt/decrypt data on server side.

type LocalEncryptionHandler

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

LocalEncryptionHandler provides functionalities to load secret key from environment variables

func NewLocalEncryptionHandler

func NewLocalEncryptionHandler() (*LocalEncryptionHandler, error)

NewLocalEncryptionHandler generates a new instance of LocalEncryptionHandler.

func (*LocalEncryptionHandler) Read

func (handler *LocalEncryptionHandler) Read(encryptedData []byte) ([]byte, error)

func (*LocalEncryptionHandler) Seal

func (handler *LocalEncryptionHandler) Seal(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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