The vCon Foundation

Standards

Encrypting a vCon for a recipient (JWE): sign, encrypt, or both

Why draft-ietf-vcon-vcon-core-05 requires signing before encryption, what the JWE form looks like, and how to choose between signed and signed-then-encrypted.

IETF working group draft Last updated 18 November 2026

Sign, encrypt, or both

A signature proves who produced a vCon and that it is unchanged; encryption hides the contents from everyone except chosen recipients. The core draft, draft-ietf-vcon-vcon-core-05, defines three forms of a vCon: unsigned, signed (JWS) and encrypted (JWE) 1. The draft has no encrypt-only form: a vCon MUST be signed first and then encrypted 1. The choice is therefore between sign only, and sign then encrypt (plus the unsigned form for work in progress).

When to use which

  • Unsigned: appropriate while a vCon is still being built inside one system, since the draft expects partial vCons that gain parties, dialog and analysis over time 1.
  • Signed only: when a vCon crosses to another security domain over a protected channel and its content may be seen by the receiver. The draft says a vCon shared outside its original domain SHOULD be signed and optionally encrypted 1.
  • Signed and encrypted: when only named recipients may read it. The draft says vCons transported over non-secure channels such as email MUST be in encrypted form 1. It also says the unredacted original referenced by a redacted vCon MUST be encrypted so that only authorized people can read it 1.

The draft explains the order: conversation data is typically collected in one domain and later stored or exported to another. Signing is meant to last for the life of the vCon while encryption may be shorter-term or specific to a domain. The signed form must be kept even when a copy is stored unencrypted 1.

What the encrypted form looks like

The encrypted vCon uses the General JWE JSON Serialization of RFC 7516 12. The plaintext is the signed vCon. The enc parameter is shared by all recipients and SHOULD be A256CBC-HS512; the key-management alg in each recipient SHOULD be RSA-OAEP; cty SHOULD be application/vcon (or application/vcon+gzip) 1. A uuid parameter lets a system identify an encrypted vCon without a key, and the receiver SHOULD verify it after decryption 1. A header parameter must not appear in more than one header location 1.

Illustrative example following draft-ietf-vcon-vcon-core-05: shape of an encrypted vCon (values elided)
{
  "protected": "<base64url of {\"alg\":\"RSA-OAEP\",\"enc\":\"A256CBC-HS512\"}>",
  "unprotected": {
    "cty": "application/vcon",
    "uuid": "0198e6a4-3c1b-8a52-9f0e-5d2c7b1a4e60"
  },
  "recipients": [
    {
      "encrypted_key": "<base64url wrapped content key>"
    }
  ],
  "iv": "<base64url>",
  "ciphertext": "<base64url of the signed vCon>",
  "tag": "<base64url>"
}

Receiving order

The draft's identification rule is that ciphertext plus recipients mean encrypted, payload plus signatures mean signed, and gzip-compressed vCons are recognized before either test 1. A receiver therefore decrypts first, then verifies the signature inside. Decrypting alone proves nothing about origin.

This example encrypts a signed vCon with the jwcrypto library 1.6.1 on Python 3.9. It builds on the signing sketch in "Signing a vCon with JWS and verifying it, step by step" and is not production code.
import json
from jwcrypto import jwk, jwe
from jwcrypto.common import json_encode
from sign_code import b64u_decode

def encrypt_vcon(signed: dict, recipient_public: jwk.JWK) -> dict:
    """Wrap an already-signed vCon (general JWS) in a general-form JWE."""
    uuid = json.loads(b64u_decode(signed["payload"]))["uuid"]
    e = jwe.JWE(
        json.dumps(signed).encode(),
        protected=json_encode({"alg": "RSA-OAEP", "enc": "A256CBC-HS512"}),
        unprotected=json_encode({"cty": "application/vcon", "uuid": uuid}),
        recipient=recipient_public,
    )
    flat = json.loads(e.serialize(compact=False))   # library emits flattened form
    flat["recipients"] = [{"encrypted_key": flat.pop("encrypted_key")}]
    return flat

def decrypt_then_verify(enc: dict, private: jwk.JWK, signer_key: jwk.JWK) -> dict:
    d = jwe.JWE()
    d.deserialize(json.dumps(enc), key=private)
    signed = json.loads(d.payload)
    from sign_code import verify_vcon
    vcon = verify_vcon(signed, signer_key)
    if enc["unprotected"]["uuid"] != vcon["uuid"]:
        raise ValueError("outer uuid does not match inner vCon")
    return vcon

The sketch builds the general JWE form by hand from the library's flattened output, uses a single recipient, and does not manage keys, rotation or distribution. Key exchange between organizations is outside the draft's scope, which says credentials for externally stored data are exchanged out of band 1.

In practice

Treat encryption as a transport and storage property, and keep a decision record of which recipient keys can read which vCons, because the draft leaves key management to deployments. Prefer signed-only for vCons that stay inside one controlled store, and encrypt at the boundary where the vCon leaves it.

Sources

  1. draft-ietf-vcon-vcon-core-05, The JSON format for vCon - Conversation Data Container (31 October 2026) (opens another site) IETF Datatracker · primary · retrieved 2026-11-18
  2. RFC 7516, JSON Web Encryption (JWE) (opens another site) RFC Editor · primary · retrieved 2026-11-18