Skip to content

Validation parity with vcon 1.0.5: JWS/JWE containers - #10

Merged
howethomas merged 1 commit into
mainfrom
jws-jwe-parity-1.0.5
Nov 19, 2026
Merged

howethomas merged 1 commit into
mainfrom
jws-jwe-parity-1.0.5

Conversation

@howethomas

Copy link
Copy Markdown
Contributor

Brings signed and encrypted vCon handling to parity with the Python reference, vcon 1.0.5.

  • Load: a JWS container (no uuid, has payload and signatures) or JWE container (no uuid, has ciphertext) is kept exactly as given. The constructor no longer invents uuid/created_at/arrays for them.
  • validateVconDict: a JWS is checked like Python's _validate_jws: the signatures array and its entries, a payload that is not base64url JSON, and the decoded payload validated as a vCon. A JWE is checked like _validate_jwe: member types and recipients, plus the "cannot be validated without decrypting" warning. The messages are identical to Python's.
  • Lawful basis pass: it runs on the signed payload's attachments and is skipped for a JWE.
  • Payload decoding: follows Python's base64.urlsafe_b64decode + json.loads. It skips non-alphabet characters, accepts both alphabets, rejects a dangling quantum and non-ASCII input, and strips a UTF-8 BOM. The 0.4.0-in-payload detection uses the same decoder.
  • New exports: signedForm(), encryptedForm() and signedPayload().

Parity vs vcon==1.0.5

  • 257-file corpus: before 256/257 identical (B7 was missing the JWE warning); after 257/257 identical, including order.
  • Synthetic cases: 175/176 identical. That's the earlier 147 plus 29 new JWS/JWE cases: bad payloads, empty or non-array signatures, header-only and malformed signatures, JWE with bad members/recipients, a signed payload with lawful basis findings, and a signed 0.4.0 payload. The one difference is only the function name in the 0.4.0 message (migrate040To050() vs migrate_0_4_0_to_0_5_0()), which already differed before this change.

@howethomas
howethomas merged commit 26505e4 into main Nov 19, 2026
2 checks passed
@howethomas
howethomas deleted the jws-jwe-parity-1.0.5 branch November 19, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant