class Capsium::Package::Cipher

Encrypts and decrypts whole Capsium packages (05x-packaging “Encryption”, 05x-security “Encrypted information”).

An encrypted .cap is a zip containing exactly:

metadata.json   (cleartext, per the standard: name/version stay
                 readable without the key)
signature.json  (the encryption envelope)
package.enc     (AES-256-GCM ciphertext of the inner, plaintext
                 .cap zip holding content/, the configuration
                 files and data/)

The envelope:

{"encryption": {"algorithm": "AES-256-GCM",
                "keyManagement": "RSA-OAEP-SHA256",
                "encryptedDek": <base64>, "iv": <base64>,
                "authTag": <base64>}}

A random 256-bit data encryption key (DEK) encrypts the inner zip; the DEK is wrapped with the recipient’s RSA public key using OAEP with SHA-256 (MGF1-SHA-256). OpenPGP key management (an armored OpenPGP message carrying the DEK) is provided by the parallel OpenPgpCipher subclass; the OCB alternative mentioned by the standard remains out of scope.