encryption

package
v0.326.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptable

type Encryptable interface {
	EncryptJSON(input any) (json.RawMessage, error)
	DecryptJSON(input json.RawMessage, output any) error
}

func NewClearTextEncryptor

func NewClearTextEncryptor(key string) (Encryptable, error)

func NewEncryptor

func NewEncryptor(keySet keyset.Handle) (Encryptable, error)

NewEncryptor encrypts and decrypts JSON payloads using the provided key set. The key set must contain a primary key that is a streaming AEAD primitive.

func NewForKeyOrURI

func NewForKeyOrURI(keyOrURI string) (Encryptable, error)

type EncryptedPayload

type EncryptedPayload struct {
	Encrypted []byte `json:"encrypted"`
}

type Encryptor

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

func (Encryptor) DecryptJSON

func (e Encryptor) DecryptJSON(input json.RawMessage, output any) error

func (Encryptor) EncryptJSON

func (e Encryptor) EncryptJSON(input any) (json.RawMessage, error)

type NoOpEncryptor

type NoOpEncryptor struct {
}

NoOpEncryptor does not encrypt and just passes the input as is.

func (NoOpEncryptor) DecryptJSON

func (n NoOpEncryptor) DecryptJSON(input json.RawMessage, output any) error

func (NoOpEncryptor) EncryptJSON

func (n NoOpEncryptor) EncryptJSON(input any) (json.RawMessage, error)

Jump to

Keyboard shortcuts

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