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.
Click to show internal directories.
Click to hide internal directories.