envelope

package
v1.9.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package envelope provides types and interfaces for envelope encryption.

Envelope encryption combines asymmetric and symmetric cryptography to efficiently encrypt data. The Encryptor interface defines the encryption operation, returning data in JWE (JSON Web Encryption) format as defined in RFC 7516.

Implementations are available in subpackages:

  • internal/envelope/rsa: RSA-OAEP-256 + AES-256-GCM using JWE

See subpackage documentation for usage examples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptedData

type EncryptedData struct {
	// Data contains the encrypted payload
	Data []byte
	// Type indicates the encryption format (e.g., "JWE-RSA")
	Type string
}

EncryptedData represents encrypted data along with metadata about the encryption type.

type Encryptor

type Encryptor interface {
	// Encrypt encrypts data using envelope encryption, returning an EncryptedData struct
	// containing the encrypted payload and encryption type metadata.
	Encrypt(data []byte) (*EncryptedData, error)
}

Encryptor performs envelope encryption on arbitrary data.

Directories

Path Synopsis
Package rsa implements RSA envelope encryption using JWE (JSON Web Encryption) format.
Package rsa implements RSA envelope encryption using JWE (JSON Web Encryption) format.

Jump to

Keyboard shortcuts

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