
A product certificate is exported, opened in another application and saved again. Its item number and material still look correct. Yet its signature no longer verifies. That does not necessarily mean the cryptography failed. The export may have changed what the signature protects.
Start with the signed representation
For the usual base64url-encoded JSON Web Signature, or JWS, signing input combines the encoded protected header, a period and the encoded payload. The payload is a byte sequence; it need not even be JSON. Reconstructing JSON from parsed values can produce different bytes, even when the values compare equal.1
A useful distinction follows: pretty-printing the outer JWS JSON object can preserve its encoded strings. Decoding the payload, reformatting it and replacing the encoded string changes the signing input. A display copy and a verification copy should not be confused.
A small check with seven cases
On October 20, 2026, a local demonstration signed a fictional two-field payload using a temporary RSA key and RS256. It then reused the original signature while changing specific inputs. The table reports all seven cases; it is an illustration of byte handling, not a production-verifier audit.
| Input presented for verification | Result |
|---|---|
| Original signed representation | Pass |
| Pretty-printed payload, original signature | Fail |
| Reordered payload properties, original signature | Fail |
| Separate formatted display; original payload retained | Pass |
| Formatted outer JWS object; encoded strings unchanged | Pass |
| Changed item value | Fail |
| Different verification key | Fail |
The compact, indented and reordered payloads parsed to equal values. Only the original representation matched the original signature. No customer records or production keys were used. Issuer trust, revocation, full JOSE validation and physical authenticity were outside this check. Download the reproducible demonstration; run it with Node.js. It generates temporary keys in memory and has no network calls.
Canonicalization is a contract, not a repair button
Some formats deliberately transform data before signing. RFC 8785 defines the JSON Canonicalization Scheme, including recursive property sorting, specified number serialization and restrictions on duplicate names. It preserves Unicode string data rather than normalizing visually similar text.2
That is more specific than “sort the keys.” Both sides must follow the agreed format. Applying a new transformation to an already signed JWS payload cannot retroactively change what its issuer signed. This demonstration did not implement or test RFC 8785.
W3C Data Integrity also defines a framework in which a selected cryptosuite specifies how data is transformed, hashed and verified. Different suites can have different transformation rules.3 The correct rule comes from the actual proof format, not from a file extension or a generic JSON utility.
Make portability an export requirement
For a product team, a practical acceptance test is straightforward: export the complete signed representation, transfer it unchanged and verify it with an independent implementation of the same format. Keep a human-readable view alongside it, not in place of it. Include the format version and the information required to locate and assess the issuer's verification method.
This is a design recommendation, not an interoperability result from the small check above. Independent implementations, key lifecycle and status handling still need their own tests. A failure should identify the failed check rather than automatically label a physical item counterfeit.
Preserve the evidence first; improve its presentation separately. A portable record needs more than familiar fields. It needs an unambiguous route back to the representation the verifier is supposed to check.
References
- Jones, Bradley and Sakimura, RFC 7515: JSON Web Signature. May 2015. Sections 2, 3 and 5 define the signing input and representations; Appendix A.2 gives an RS256 example. The article discusses the ordinary encoded-payload form, not every extension.
- Rundgren, Jordan and Erdtman, RFC 8785: JSON Canonicalization Scheme. June 2020; Informational, Independent Submission. Sections 3.1 and 3.2 specify input constraints and serialization.
- W3C, Verifiable Credential Data Integrity 1.0. Recommendation, May 15, 2025. Sections 1.1, 5.7 and 5.13 explain transformations and cryptosuite requirements.
Sources reviewed October 20, 2026. These are established specifications, not newly announced features. The demonstration tests one narrow behavior; it does not certify a product, format implementation or security library.